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 many-to-one-relationship with recordings and songs, so that
> one song can have several recordings.
> In a view, I filter the songs by certain parameters and pass a
> variable 'songs' to the template.
>
> In the template, I just want to display the recordings which have the
> attribute 'represents_song', which is boolean, set to true.
> This is always just one recording.


> As I can't filter the recordings in the view, I have to filter them in
> the template.
> Is there any possibiltiy to filter {{ for recording in
> song.recording_set.all }}?
> And by the way: Why has it to be FOO_set.all and not FOO_set?
>
> -benjamin
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to