On Fri, 2007-06-15 at 03:17 -0700, Tipan wrote: > > On Jun 14, 10:50 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > See django/db/models/loading.py, in the register_models() function. > > > > I'm not 100% certain that will be the right fix, but from reading the > > ticket and the model dispatching code, it looked like the right idea. > > Not a change worth making to core just yet, though, since Brian Harring > > is rewriting signal dispatching, so it will either be done as part of > > that or something we can fix when he's finished. > > > Thanks again Malcolm. I need to resolve this now so a workround is > going to be essential. > > I've looked through the loader.py code and although I understand the > principle of what it's doing I'm not proficient enough in Python to > execute the work round with ease. > > My problem is how I can get the source filename of the object that is > sending the signal and compare with that in the imported models.
One way would be to use Python's "inspect" module. > I was planning to do this in the function that is run from the > desptacher.connect statement. > > For example - When I save to Table1, I want to update a total in Table > 2. In my function, I was hoping to get the sourcefile name of the > sender (Table1) and then check this with the imported models - > wherever these reside. > > Can you suggest a method (or line of code) that will help me establish > the source details for comparison. > > If the two don't match, I was then going to pass, so that it avoided > the duplication. > > Is this approach sound? It might work. Try it out and see. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---