Login

Snippets by charettes

Snippet List

Create permissions for proxy models

Until [#11154] is fixed, django won't create permissions for proxy models for you as it does with other models, even the one you define using the [`permissions` option](https://docs.djangoproject.com/en/dev/ref/models/options/#django.db.models.Options.permissions) on your models. This snippet will make sure all permissions are create for proxy models. Just make sure this code gets loaded after the `update_contenttypes` handler is registered for the `post_syncdb` signal. Putting this code in one of your `INSTALLED_APPS' after `django.contrib.contenttypes' should do it.

  • admin
  • permission
  • proxy
Read More

charettes has posted 1 snippet.