I'm still struggling with this... came up with

 EventFormClass.base_fields['club'].widget =
widgets.Select(choices=Club.objects.filter(approved=True))

But that throws
TypeError at /clubs/events/
unpack non-sequence

Any ideas?


On Jul 5, 2:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I have an "Event" model that has a foreignkey relationship with
> "Club", and I'm using form_for_model to create the form. This spits
> out all "Club" entries in a dropdown.
>
> The trick is, "Club" has a boolean field for "approved", and I want to
> filter according to that.
>
> So, is there some way to filter it? At the newform level. Should I get
> 'club.objects.filter(approved=true)' and pass that to form somehow
> (maybe form.club = approvedclubs)?
>
> Thanks.


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