Groups
Groups
Sign in
Groups
Groups
Django users
Conversations
About
Send feedback
Help
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 AM
12/2/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 AM
12/2/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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