#6040: post_syncdb signal and contrib.auth permissions
---------------------------------------+------------------------------------
Reporter:  Dan <[EMAIL PROTECTED]>  |       Owner:  nobody                      
               
  Status:  new                         |   Component:  Contrib apps             
                  
 Version:  SVN                         |    Keywords:  auth contrib.auth 
post_syncdb management.py
   Stage:  Unreviewed                  |   Has_patch:  0                        
                  
---------------------------------------+------------------------------------
 This is a feature request for contrib.auth's management.py

 In an app's management.py, doing:

 {{{
 from myapp import models
 from django.contrib.auth.models import Permission

 def init_data():
     perm = Permission.objects.get(codename=<permission string for
 models.my_model>)

 dispatcher.connect(init_data, sender=models, signal=signals.post_syncdb)
 }}}

 where <permission string for models.my_model> is something like
 "change_mymodel", will trigger a DoesNotExist exception on first run of
 syncdb.

 The problem is that contrib.auth is receiving the post_syncdb signal
 before "myapp", and there doesn't appear to be a way to force myapp to be
 the last receiver of the signal.  Changing the order of the apps in
 settings.py has no effect.

 A suggested solution would be to add a new signal fired by contrib.auth
 after creation of permissions.  Or am I missing an obvious way to handle
 after contrib.auth?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6040>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to