hmm, replying to myself again because i can't wrap my head around it. i drilled down to the boolean include_blank (which in turn seems to add or not add BLANK_CHOICE_DASH) but that's only found in db/models/fields/__init__.py and the magic that actually decides whether the dash option is added or not to a form is a bit above my head.
could it be that the dash-option just cannot be disabled in current django? if so i'd love to see that fixed as i fear i'm not capable to patch it myself properly. -mark On Fri, 2007-09-07 at 01:31 +0200, Mark Green wrote: > Hi all, > > This is my model: > > class Person(models.Model): > GENDER_CHOICES = ( > ( 'm', 'Male' ), > ( 'f', 'Female' ), > ) > gender = models.CharField( blank=False, "gender", maxlength=1, > choices=GENDER_CHOICES, default='m' ) > > > > Using form_for_model() on the above model results in HTML like this: > > <select name="gender" id="id_gender"> > <option value="" selected="selected">---------</option> > <option value="m">Male</option> > <option value="f">Female</option> > </select> > > > How do I get rid of the first option (the dashes)? > I would prefer to have the <select>-widget default to my default-value. > > Any help appreciated! > > > -mark --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---