I'm having trouble with generating a QuerySet using a reverse
ForeignKey lookup, and I'm not sure why I'm getting an error.
Here is my model, with only the relevant attributes shown:
def EntryStatus(models.Model):
...
user = models.ForeignKey(User)
entry = models.ForeignKey(Entry)
where Entry is another of my models and User is Django's own.
I want a QuerySet of Entry objects from a specific user, so I have
tried the following but received an AttributeError:
>>> Entry.objects.filter(entrystatus__user=3)
(large traceback...)
File "D:\Program Files\Python
2.4.1\lib\site-packages\django\db\models\query.py", line 873, in
lookup_inner
column = field.column
AttributeError: 'RelatedObject' object has no attribute 'column'
Can anyone shed light on this and/or tell me what I should be doing
instead?
Thanks.
--
Cathy
http://www.bentbacktulips.co.uk/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---