I have exactly the same problem.

Hope someone could help.


On 27 août, 22:03, sagi s <[EMAIL PROTECTED]> wrote:
> I am generating a form for a model that contains a CharField withchoices. 
> According to the documentation I expect to see this
> translated into a SELECT form field but all I get is a simple TEXT
> form field:
>
> models.py:
> class Publication(models.Model):
>     PUBLICATION_TYPES = (
>         ('B',  'Book'),
>         ('P',  'Periodical'),
>         ('D',  'DVD'),
>         ('C',  'CD'),
>         ('O',  'Other'),
>     )
>     type = models.CharField(maxlength=1,choices=PUBLICATION_TYPES)
> ...
>
> >>> from django importnewformsas forms
> >>> pubform = forms.form_for_model(Publication)
> >>> pf = pubform()
> >>> pf.as_table()
>
> u'<tr><th><label for="id_type">Type:</label></th><td><input
> id="id_type" type="t
> ext" name="type" maxlength="1" /></td></tr>\n<tr><th>...
>
> Any idea?


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

Reply via email to