On Wed, Mar 30, 2011 at 4:55 PM, George Karpenkov <true.chesh...@gmail.com> wrote: > Oh thanks Russel! > > Turns out django-tagging was creating those objects via the post-save > signal hook. > > http://code.djangoproject.com/ticket/8399 <- here is the ticket which > proposes an option to disable the signal handling during the loaddata > operation. > > Malcolm says that some people might want to use signals while running > loaddata - ie to create related objects. > > I don't really understand why anyone would want that -- the only use > case I've ever seen for the loaddata operation was "dump the entire > database -> load entire database", though I guess use cases differ.
There's the rub -- use cases do differ. Even in the "dump and load" scenario, there are at least two ways to interpret the problem: * Dump the *entire* database, and load the *entire* database * Dump the "core" of the database, and reconstitute parts of the database that can be automatically rebuilt. Consider, for example, model permissions or contenttypes -- should they be serialized and reloaded, or generated and reference (using natural keys)? > Any updated comments on disabling the signal handling for the loaddata > operation? Not beyond what is listed in that ticket. The original solution proposed is the obvious solution and Malcolm has raised the obvious objection. The ticket has been accepted; there is merit in the idea in principle; it's just a matter of finding a workable solution that doesn't suffer from the problem Malcolm highlights. I can see how gsong's solution would work, but I'm not wild about it. Firstly, it requires stack inspection, which wont necessarily catch all the ways the signal may need to be silenced. Secondly, it requires registration at the time the signal is defined, which means that if a signal is provided as part of a third party app, the app author (and not the end-user) makes the decision as to whether the signal should be silenced. This may be possible in many cases, but there will be cases where this isn't possible. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.