Re: how to get a queryset by a ManyToMany field

2008-02-08 Thread coldpizza
This definitely makes sense, I have made a view called `books_by_author` - this made it easy for me to fit the logic into my feeble mind, and moreover it looks good in the URLconfs. Thanks a lot for suggestions! On Feb 8, 7:57 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > On 2/8/08, coldpi

Re: how to get a queryset by a ManyToMany field

2008-02-08 Thread Jacob Kaplan-Moss
On 2/8/08, coldpizza <[EMAIL PROTECTED]> wrote: > And other related question: where it would be more logically correct > to put this code? In URLConf as an parameter for the view, in a view > of its own, or in a method bound to the Book model? I wouldn't put it in a URLconf. URLconfs are supposed

Re: how to get a queryset by a ManyToMany field

2008-02-08 Thread coldpizza
Thanks a lot! Before posting I have spent over an hour reading and rereading that particular page in the doc section and in the Djangobook but still somehow the concept eluded me. I do admit though that I do not have previous experience solving this sort of issues in other languages. Maybe adding

Re: how to get a queryset by a ManyToMany field

2008-02-08 Thread Jacob Kaplan-Moss
On 2/8/08, coldpizza <[EMAIL PROTECTED]> wrote: > Given that I have a Book model with a ManyToManyField called authors > how do I get all the books for a particular author? Each book may have > more than one author, so I cannot filter the books using the standard > methods. You'll want to more cl

how to get a queryset by a ManyToMany field

2008-02-08 Thread coldpizza
Sorry if this is too trivial but I have looked through the docs and could not find a clear answer. Given that I have a Book model with a ManyToManyField called authors how do I get all the books for a particular author? Each book may have more than one author, so I cannot filter the books using t