1👍
The groups__name
documentation is basically found as a combination of the auth.User documentation and the fields lookup documentation, with the assumption you know that auth.models.User
has a method groups
that relates to auth.models.Group
.
limit_choices
only limits the choices available in the admin and (Model)forms; it doesn’t limit the choices in the database, so any available choice can still be programmatically set; in your case, none at all (default). You could poke inside the database and see what it actually gives you for the pm
field.
0👍
limit_choices_to
only limits choices in select
s in forms (in admin and in your own ModelForm
s). In your code, you can still assign whoever you like.
The django.contrib.auth
documentation covers the User
and Group
models and their fields.