Solving (partially) South issue on not updating permissions.

9 Mar

South have a already know issue [1] about no update permissions of added models. The common fix is run manage.py syncdb –all, Django Extensions [2] app also have a management command called update_permissions what is very usefull and also do the job.

But, any of us want to remember about that every time, so to automatize permissions creation I ‘copied’ idea of Django Extensions update_permissions command and put it to a method connect to a post_migrate [3] South signal. This do the job every time a app is migrated and with time can be extended to remove permissions also :). The code use built in Django features.

Here is the code, I put it in my project/__init__.py:

Links:
[1] http://south.aeracode.org/ticket/211
[2] http://packages.python.org/django-extensions/
[3] http://south.aeracode.org/docs/signals.html#post-migrate

VN:F [1.9.22_1171]
Rating: 5.0/5 (7 votes cast)
Solving (partially) South issue on not updating permissions., 5.0 out of 5 based on 7 ratings


Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 72 bytes) in /home/devwithpassion/devwithpassion.com/wp-content/plugins/gd-star-rating/code/cache.php on line 59