Op donderdag 22-02-2007 om 20:08 uur [tijdzone +1100], schreef Malcolm
Tredinnick:
> On Thu, 2007-02-22 at 01:38 +0100, enquest wrote:
> > I have two models for testing purpose... I realy need to solve this
> > problem. If not I will have to stop using Django what would be a pitty.
> > But I can't spend an other day searching!!!! This problem occurs on a
> > Debian apache2 server (fresh install)
> > 
> > model 1
> > from django.db import models
> > from bar.models import Test
> 
> Try changing this to
> 
>         from bar import models as bar_models
> 
> and later on (in the model)
> 
>         bar = models.ForeignKey(bar_models.Test)
>         
> I'm not guaranteeing that will fix anything, but there is one very
> tricky import-related bug in the way we work out relations between
> models (and cache the models). It is being worked on (by me), but hasn't
> been fixed yet.
> 
> If you care about the details, the reason this might work is that by
> changing the import in this way, you are not forcing Python to look
> inside the bar.models module to resolve the Test name at import time.
> Instead, you are just ensuring that bar.models is in the current
> namespace (you have to import as something other than "models", since
> you have already imported django.db.models under that name). This leaves
> the name lookup (bar_models.Test, in my example) until later in the
> show, when all the imports and model loading has been completed.
> 
> It would be interesting to know if this does fix things for you, because
> it is another data point in chasing this bug. Unfortuantely, the bug is
> very dependent on the Python version, architecture and OS that it is
> installed on, so just because it fails for you on one particular setup,
> doesn't mean it will fail for you in another case (or for anybody else
> with a similar setup). So realise that I cannot tell you for certain
> that this fix will do anything at all -- but it looks similar to some
> other reports.
> 
> Regards,
> Malcolm
> 
> 
> > 

Nope that did not work. I have sended you a private mail!

enquest


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