{{{
import django
from django.forms import Form
from django.forms import CharField
PersonForm = type('Person', (Form,), {"work
address":CharField(max_length=128)})
person = PersonForm()
person.as_ul()
}}}
You get
{{{
'<li><label for="id_work address">Work address:</label> <input type="text"
name="work address" maxlength="128" required id="id_work address" /></li>'
}}}
I think the `id="id_work address" ` is suboptimal here. At least the doc,
which references `id_<field-name>`, should be improved (also present in
2.0 doc)
--
Ticket URL: <https://code.djangoproject.com/ticket/29011>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> If you do:
>
> {{{
> import django
> from django.forms import Form
> from django.forms import CharField
> PersonForm = type('Person', (Form,), {"work
> address":CharField(max_length=128)})
> person = PersonForm()
> person.as_ul()
> }}}
>
> You get
> {{{
> '<li><label for="id_work address">Work address:</label> <input
> type="text" name="work address" maxlength="128" required id="id_work
> address" /></li>'
> }}}
>
> I think the `id="id_work address" ` is suboptimal here. At least the doc,
> which references `id_<field-name>`, should be improved (also present in
> 2.0 doc)
New description:
If you do:
{{{
import django
from django.forms import Form
from django.forms import CharField
PersonForm = type('Person', (Form,), {"work
address":CharField(max_length=128)})
person = PersonForm()
person.as_ul()
}}}
You get
{{{
'<li><label for="id_work address">Work address:</label> <input type="text"
name="work address" maxlength="128" required id="id_work address" /></li>'
}}}
I think the `id="id_work address" ` is suboptimal here. Maybe everything
should be underscored? At least the doc, which references `id_<field-
name>`, should be improved (also present in 2.0 doc)
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29011#comment:1>
* status: new => closed
* type: Uncategorized => Cleanup/optimization
* resolution: => wontfix
Comment:
I don't see a strong argument for making a change here. If you're
generating field names that aren't valid when using a normal declarative
form, you're on your own. I don't think this is a normal use case that
needs documentation.
--
Ticket URL: <https://code.djangoproject.com/ticket/29011#comment:2>