2017-03-10 20 views

回答

1

您可以PermissionsMixin類中看到:

""" 
A mixin class that adds the fields and methods necessary to support 
Django's Group and Permission model using the ModelBackend. 
""" 
... 
groups = models.ManyToManyField(
    Group, 
    verbose_name=_('groups'), 
    blank=True, 
    help_text=_(
     'The groups this user belongs to. A user will get all permissions ' 
     'granted to each of their groups.' 
    ), 
    related_name="user_set", 
    related_query_name="user", 
) 
... 

所以它的名字是groups。您必須將其添加到UserCreateFormUserAdmin的字段集中。

相關問題