Is there any way to make USStateField() to not have a pre-selected value?

0 views
Skip to first unread message

Continuation

unread,
Dec 2, 2009, 12:01:04 AM12/2/09
to Django users
I use USStateField() from localflavor in one of my models:

class MyClass(models.Model):
state = USStateField(blank=True)

Then I made a form from that class:

class MyClassForm(forms.ModelForm):
class Meta:
model = MyClass

When I display the form, the field "State" is a drop-down box with
"Alabama" pre-selected.

Is there any way to make the drop-down box to show no pre-selected
value at all?

rebus_

unread,
Dec 2, 2009, 4:46:31 AM12/2/09
to django...@googlegroups.com
2009/12/2 Continuation <selfor...@gmail.com>:
> --
>
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>
>

Maybe using default as argument to your field?

http://docs.djangoproject.com/en/dev/ref/models/fields/#default
Reply all
Reply to author
Forward
0 new messages