django - Adding django_content_type and permission without model -
i want have permissions on few contents, not models
, 'name' in following table:
mysql> select * my_contents; +----+---------------------+ | id | name | +----+---------------------+ | 1 | content1 | | 2 | content2 |
i understand django's permission model requires contenttype instance. so, inserted these 2 entries in django_content_type table
arbitrary app_label
, model
. like:
| 20 | content1 | some_label | content1 | | 21 | content2 | some_label | content2 |
now, thinking on running syncdb
permissions these 2 new contents created automatically in auth_permission
, instead, get:
the following content types stale , need deleted: some_label | content1 some_label | content2
how update permissions these 2 contents (without model) ?
what attempting sounds per object permissions. each object within model want set permissions on it. django not support django-guardian does. if @ link provides simple example on how achieve outcome.
if want have permission not have matching model have at snippet. have not tested personaly
Comments
Post a Comment