nkeric wrote:

>class ArticleType:
>    name = ...
>
>class Article:
>    title = ...
>    article_type = meta.ForeignKey(ArticleType)
>
>class Game:
>    name = ...
>    articles = meta.ManyToManyField(Article)
>
>how can I retrive the articles of a certain article type of a given
>game?
>
>  
>
>>>>g = games.get_object(pk=1)
>>>>g.get_article_list(article_type_id__exact=1)
>>>>        
>>>>
It's g.get_article_list(article_type__id__exact=1). Note 2 underscores 
before "id" which means field "id" of a parent table.

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