I've got a big cars model. Some are assigned to one site, some to the other. In the form I only want to show the ones appropriate to the site, so in my view I've got: cars = Car.objects.filter(sites__id__exact=settings.SITE_ID) car_choices = [(i.slug, i.make) for i in cars] FormClass = nforms.form_for_model(Club) # Create the form class FormClass.base_fields['club_cars'].widget = widgets.SelectMultiple(choices=car_choices)
Which - as expected - creates a multi-select box with the appropriate cars. Problem is, when the user selects one the form validation kicks it out, saying it is not a valid choice. If I don't use the custom widget everything is fine, other than it showing cars it shouldn't. What am I missing here? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---