In this example, what if you wanted to selectively remove a value from the choice list. For example, let's say the list contained New, In Process, and Closed. When an item is "In Process", it cannot revert back to "New". As such, "New" should not be displayed amongst the choices if "In Process" has been selected.
I realize I could eliminate the value using JavaScript on the front- end, but is there a way to bake that logic into the form Model? On Jun 7, 7:20 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > On Jun 7, 4:18 pm, Berco Beute <[EMAIL PROTECTED]> wrote: > > > Quite a lot of work for something so simple > > I agree that overriding default widgets is currently too much work. > But here's a slightly shorter version that works in exactly the same > way as your example:: > > class SomeForm(forms.ModelForm): > class Meta: > model = SomeModel > > car = forms.ModelChoiceField(Car.objects.all(), > empty_label=None) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---