I guess you can use the choices in the form that you´ve created!
class AuthorForm(forms.Form):
name = forms.CharField(max_length=100)
title = forms.CharField(max_length=3,
widget=forms.Select(choices=TITLE_CHOICES))
birth_date = forms.DateField(required=False)
Take a l
Sorry, I was little unclear above. I need to set the default for a
form.
--~--~-~--~~~---~--~~
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 uns
You can set the default choice in the model like this.
SEARCH_CHOICES = (
('G', 'google'),
('Y', 'Yahoo'),
('L', 'Live Search'),
)
Now, your model will be set like this...
class anything(models.Model):
title = models.CharField(max_length = 80)
search_engine = models.CharFiel
Hi,
I'm defining a form model, and I have a choice field. I have the
values in order, and I want one value (in the middle of the values in
order) to be the default. How do I do that?
Passing initial= anything doesn't work.
--~--~-~--~~~---~--~~
You received this
4 matches
Mail list logo