Re: Foreign keys and applications

2006-06-15 Thread Luke Plant
On Thursday 15 June 2006 19:12, Luke Plant wrote: > This is because your models are in different apps. I can't remember > off-hand what the correct syntax is of course, the way to find out is to use the /admin/doc/ view, or examine the object with 'dir' in a python interactive shell, or the t

Re: Foreign keys and applications

2006-06-15 Thread Luke Plant
On Wednesday 14 June 2006 12:20, Viktor wrote: > I have two applications in my project: > ... > But when in my views I try to do: > > c1 = Cls1.objects.get(pk=1) > clss = c1.cls2_set.all() > > I get: > > 'Cls1' object has no attribute 'cls2_set' This is because your models are in different apps.

Foreign keys and applications

2006-06-14 Thread Viktor
I have two applications in my project: project app1 models.py app2 models.py project/app1/models.py: class Cls1(models.Model): ... project/app2/models.py: from