Re: How to filter FOO_set in templates?

2008-08-23 Thread Garrett Garcia
On Sat, Aug 23, 2008 at 11:50 AM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > Am 22.08.2008 um 23:15 schrieb Garrett Garcia: > > How about: > > songs = Recording.objects.filter(song__title__startswith='R', > represents_song=True) > >

Re: How to filter FOO_set in templates?

2008-08-23 Thread Benjamin Buch
Am 22.08.2008 um 23:15 schrieb Garrett Garcia: > How about: > > songs = Recording.objects.filter(song__title__startswith='R', > represents_song=True) > > http://www.djangoproject.com/documentation/db-api/#filter-kwargs > > "Multiple parameters are joined via AND in the underlying SQL >

Re: How to filter FOO_set in templates?

2008-08-23 Thread Benjamin Buch
Am 22.08.2008 um 23:15 schrieb Garrett Garcia: > How about: > > songs = Recording.objects.filter(song__title__startswith='R', > represents_song=True) > > http://www.djangoproject.com/documentation/db-api/#filter-kwargs > > "Multiple parameters are joined via AND in the underlying SQL >

Re: How to filter FOO_set in templates?

2008-08-22 Thread Garrett Garcia
On Fri, Aug 22, 2008 at 3:24 AM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > > > > I'm not sure i understand you question. You can filter via the > > attributes of a related object like this: > > Recording.objects.filter(song__artist="Ben Folds") > > Yes, and that's perfectly all right when you

Re: How to filter FOO_set in templates?

2008-08-22 Thread Benjamin Buch
> I'm not sure i understand you question. You can filter via the > attributes of a related object like this: > Recording.objects.filter(song__artist="Ben Folds") Yes, and that's perfectly all right when you are only interested only in the related objects. But what do you do when you want

Re: How to filter FOO_set in templates?

2008-08-21 Thread Garrett Garcia
On Wed, Aug 20, 2008 at 11:17 PM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > > Hi Garret, > > > How about sending the template something like: > > > > songs = Recording.objects.filter(represents_song=True) > > > > A custom manager seems like overkill for this situation (If I'm > > understanding

Re: How to filter FOO_set in templates?

2008-08-21 Thread Benjamin Buch
Hi Garret, > How about sending the template something like: > > songs = Recording.objects.filter(represents_song=True) > > A custom manager seems like overkill for this situation (If I'm > understanding you right). > > - Garrett this is indeed a plausible sollution. I then had to access the

Re: How to filter FOO_set in templates?

2008-08-19 Thread Garrett Garcia
How about sending the template something like: songs = Recording.objects.filter(represents_song=True) A custom manager seems like overkill for this situation (If I'm understanding you right). - Garrett On Sat, Aug 16, 2008 at 2:34 PM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > I have a