On Jun 5, 7:36 am, Berco Beute <[EMAIL PROTECTED]> wrote:
> My model has a ForeignKey that renders as a SELECT field in HTML. The
> problem is that there's an empty value ('---------') that I would like
> to hide.Presuming you are using newforms (i.e. not the Admin), then override the ModelChoiceField [1] for that ForeignKey in your form and pass the argument ``empty_label=None`` [2]. .. [1] http://www.djangoproject.com/documentation/newforms/#modelchoicefield .. [2] http://code.djangoproject.com/browser/django/trunk/django/newforms/models.py?rev=7326#L303 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

