Jorge Gajon wrote: > > On 5/19/06, Gábor Farkas <[EMAIL PROTECTED]> wrote: >> and the strange thing (the reason why i'm reporting this) is that just >> based on the difference in the "from" statement, i get different results >> (works in first case, fails in second case). >> > > You should always use 'from' like this: > from proj1.app1.models import MyModel
i understand that it's safer to do, but quite ugly in my opinion. why should my code depend on the name of the project, after all.. > > Also, I'm recalling from memory so I could be totally wrong here, but > I kind of remember that you would fetch the related set <snip/> yes, related_name works like that. but it works (and fails) the same way as the "unnamed" reverse-lookup. > I normally look into the tests that come in trunk/tests first. They > are very good to find out how to use some feature. > actually, that was the place where i started (when i saw that my reverse lookups do not work), and found that the test's reverse lookups do work. and for some strange reason, this only happens in non-web (manage.py shell, or "standalone" python script) situations. in "normal" view code i can use this import without problems. anyway, it's not such a big problem as such. the problem i think is that it can lead to confusing situations (the "non-reverse" lookups work fine in the from-app1.models situation too). thanks, gabor --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---