What is the difference between users_user_permissions and auth_permission and auth_group_permissions?

Django auto-generates over tables with syncdb, but I can't figure out what these tables are for. Sorry for the silly question, but I just started with groups and permissions.

+3


source to share


1 answer


Django's schema for automatically generating table names is explained here . Basically, it uses the app_model template. In the case of ManyToManyFields, which are implemented by creating a new table to hold the relationship, this becomes app_model1_model2s.

So:

auth_permission is a table representing the model auth.Permission

.



auth_group_permissions is a table that represents the ManyToMany relationships between auth.Group

and auth.Permission

.

users_user_permissions is a table that represents ManyToManyField

between users.User

and auth.Permission

. (I am assuming this is coming from the application you are using? The Django version contrib.auth

should be auth_user_user_permissions

.)

See the documentation for how these tables are actually used.

+3


source







All Articles