Shouldn't that be:
limit_choices_to= 
{'meeting__application__name__exact':meeting.application.name}

On 05/07/2006, at 6:53 AM, william wrote:

>
> I'm running with svn r-3275.
>
> I have the following models:
>
> class Application(models.Model):
>     name = models.CharField(maxlength=50)
>     ....
>
> class Meeting(models.Model):
>     application = models.ForeignKey(Application)
>     ....
> If I'm using, in this class,
> limit_choices_to={'application__name__exact':application.name} it  
> works
> fine. Good ;-).
>
>
> class Decision(models.Model):
>     meeting = models.ForeignKey(Meeting)
>     ...
> if I'm using, in this class,
> limit_choices_to={'application__name__exact':meeting.application.name}
> it does NOT work.
> The error message is:
> " 'ForeignKey' object has no attribute 'application' "
>
>
> Within a shell, the following works:
> "
> d=Decision.objects.get(id=1)
> print d.meeting.application.name
> "
>
> Why it does not work within the model ?
> Why application.name works and meeting.application.name does not ?
>
> Thanks
>
>
> >


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

Reply via email to