I have created a custom manipulator for a search form.

#############################
from django import forms
from choices import AIRCRAFT_CHOICES, phase_choices, OBJECT_CHOICES,
STATUS_CHOICES

class SelectStatusManipulator(forms.Manipulator):
    def __init__(self):
        self.fields = (
        forms.RadioSelectField(field_name="object_type",
choices=OBJECT_CHOICES, is_required=True),
        forms.RadioSelectField(field_name="status",
choices=STATUS_CHOICES, is_required=True),
        forms.SelectField(field_name="phase", choices=phase_choices(),
is_required=False),
        forms.SelectField(field_name="tail_number",
choices=AIRCRAFT_CHOICES, is_required=False),
    )
#############################

It works just fine except that when it creates the phase and
tail_number SELECT elements in the template it doesn't create the
<option value="">-----</option>.  I expected this since it does this in
the admin and I have also made is_required=False. Never assume anything
I guess.

Am I missing something? I looked at the Django source and I didn't see
anyway to include the "blank" option other than to add
   ('','-------------')
at the top of the AIRCRAFT_CHOICES and phase_choices.

Thanks,
/Paul


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

Reply via email to