On 1/24/07, yary <[EMAIL PROTECTED]> wrote: > > I presume that the custom permissions and initial data loading is also > kicked off from the post_syncdb signal, and that my management.py is > getting the signal first. How to fix/work around?
The syncdb process does the following, in the following order: - adds any new models - For each model in the app (including old models): - Invoke the post_syncdb signal - if the model is new, install the initial data/SQL for the app - Install the SQL indicies for the model One option for a workaround Is to try using the ticket #2333 fixtures patch (a version of which will be in Django v1.0) and see if that helps. One of the goals of the fixtures framework is to rename 'initial data' to 'custom SQL' - the goal here being to move the loading of initial data out of SQL statements into a database independent fixture format (JSON, XML, etc), reserving the 'custom SQL' step for any table modifying statements required by a project. The loading of data fixtures would be the last step in a sync; an 'initial_data' fixture will be installed as the last step of the syncdb. In this way, the tables should be created, permissions set, etc before the data is loaded. The current patch on #2333 doesn't do this automatic data install on syncdb, but this should be in the final version. In the meantime, a manual call to 'manage.py installfixture initial_data' will do the trick. A post-post signal won't fix the problem; if you have a post-post signal, then why not a post-post-post signal, and so on - the underlying problem is resolving dependencies. Forcing installation data fixtures into the last phase will resolve the dependency problem you have described. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---