1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

magic-removal: updated permissions section in authentication docs to use syncdb instead of the now defunct installperms.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2718 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2006-04-21 14:58:10 +00:00
parent d8ae61b59a
commit 9d2992b1c8

View File

@ -393,15 +393,13 @@ Default permissions
Three basic permissions -- add, create and delete -- are automatically created Three basic permissions -- add, create and delete -- are automatically created
for each Django model that has ``admin`` set. Behind the scenes, these for each Django model that has ``admin`` set. Behind the scenes, these
permissions are added to the ``auth_permission`` database table when you run permissions are added to the ``auth_permission`` database table when you run
``django-admin.py install [app]``. You can view the exact SQL ``INSERT`` ``django-admin.py syncdb``.
statements by running ``django-admin.py sqlinitialdata [app]``.
Note that if your model doesn't have ``admin`` set when you run Note that if your model doesn't have ``admin`` set when you run
``django-admin.py install``, the permissions won't be created. If you ``django-admin.py syncdb``, the permissions won't be created. If you
initialize your database and add ``admin`` to models after the fact, you'll initialize your database and add ``admin`` to models after the fact, you'll
need to add the permissions to the database manually. Do this by running need to run ``django-admin.py syncdb`` again. It will create any missing
``django-admin.py installperms [app]``, which creates any missing permissions permissions for all of your installed apps.
for the given app.
Custom permissions Custom permissions
------------------ ------------------
@ -436,8 +434,8 @@ Fields
``Permission`` objects have the following fields: ``Permission`` objects have the following fields:
* ``name`` -- Required. 50 characters or fewer. Example: ``'Can vote'``. * ``name`` -- Required. 50 characters or fewer. Example: ``'Can vote'``.
* ``package`` -- Required. A reference to the ``packages`` database table, * ``content_type`` -- Required. A reference to the ``django_content_types``
which contains a record for each installed Django application. database table, which contains a record for each installed Django model.
* ``codename`` -- Required. 100 characters or fewer. Example: ``'can_vote'``. * ``codename`` -- Required. 100 characters or fewer. Example: ``'can_vote'``.
Methods Methods