Excellent, this works!

Now, probably the documentation is misleading. From documentation/db-
api:

<quote>
    You cannot access a reverse ForeignKey Manager from the class; it
must be accessed from an instance. Example:
        Blog.entry_set # Raises AttributeError: "Manager must be
accessed via instance".
</quote>

I don't think I saw elsewhere that '_set' had not to be used.

Anyway, thanks Russ,

JJ.

On Jul 16, 1:13 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/16/07, jj <[EMAIL PROTECTED]> wrote:
>
>
>
> > Now I'd like to restrict the query to books which have been printed in
> > 'Holland':
> >     q = q.filter(foreign_print_set__country='Holland')
>
> Try:
>
>      q = q.filter(foreignprint__country='Holland')
>
> foreignprint doesn't get an underscore unless it is defined that way;
> the _set suffix is not used when composing queries.
>
> Yours,
> Russ Magee %-)


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

Reply via email to