阅读背景:

Django - UserProfile m2m字段管理错误

来源:互联网 

My models:

我的模型:

class UserProfile(models.Model):
    TYPES_CHOICES = (
        (0, _(u'teacher')),
        (1, _(u'student')),
    )
    user = models.ForeignKey(User, unique=True)
    type = models.SmallIntegerField(default=0, choices=TYPES_CHOICES, db_index=True)
    cities = models.ManyToManyField(City)
class City(models.Model):
    name = models.CharField(max_length=50)
    slug = models.SlugField(max_length=50)
class UserProfile(models.M



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: