我对 django 1.5 有一些问题,回溯是
'MyUserAdmin.fieldsets[3][1]['fields']' refers to field 'l' that is missing from the form.
代码是
fieldsets = (
(None, {'fields':('name', 'password')}),
('User info', {'fields':('email',)}),
('Permissions',{'fields':('is_admin',)}),
('Important dates',{'fields':('last_login,')}),
)
class MyUser(AbstractBaseUser, PermissionsMixin):
name = models.CharField("姓名", max_length=20, unique=True, db_index=True)
consumption= models.DecimalField("菜品总消费", max_digits=5, decimal_places=0)
email = models.EmailField(max_length=75)
times = models.DecimalField("消费次数", max_digits=4, decimal_places=0)
USERNAME_FIELD = 'name'
REQUIRED_FIELDS = ['email', ]
is_active = models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)
@property
def is_staff(self):
return self.is_admin
def __unicode__(self):
return unicode(self.nam
我无法修复它,我不明白“字段'l'”的意思