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.CharField(max_length = 1, choices =
SEARCH_CHOICES, default = 'google')


Hope it help!!

Fred Chevitarese - GNU/Linux
http://chevitarese.wordpress.com

2009/7/15 Wiiboy <jordon...@gmail.com>

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


-- 
http://chevitarese.wordpress.com

Fred Chevitarese - GNU/Linux

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to