On Jan 23, 6:10 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote (in different order):
> 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.

A good goal and a good plan.

> 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.

The app will run on a host where I don't have control over the Django
install- though I can probably work around that :-) And I have a
workaround for now, will just run my group-creation script manually. So
will wait for Django 1.0.

> 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
...
> 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.

Two things- going back to my original issue, the post_syncdb signal
wasn't working because the custom permissions (in the Meta nested
class) weren't yet created. I also noticed the SQL hadn't been
executed, which wasn't an issue for me, but was easier to illustrate.

The other thing, if I understand patch #2333, the syncdb order will be:
1. add any new models
2. For each model in the app (including old models):
    3. if the model is new, install initial fixture
    4. Invoke the post_syncdb signal
      4.1 contrib.auth listens to post_syncdb to create custom
permissions (my guess as to how it's done now, won't change?)
    5. if the model is new, install the initial data/SQL for the app
6. Install the SQL indicies for the model

If that's correct, then I still have a problem, because I'm hoping to
reference some custom permissions. Unless step 5 is going to become
python code being executed, and not a stright-up SQL file being loaded,
or ... what will the syncdb order be, exactly?

thanks!


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to