#29011: forms.Field with space in dynamically generated forms.Form leads to wrong assigned id in generated HTML form -----------------------------------------+------------------------ Reporter: pdehaye | Owner: nobody Type: Uncategorized | Status: new Component: Forms | Version: 1.11 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 1 UI/UX: 0 | -----------------------------------------+------------------------ 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) -- Ticket URL: <https://code.djangoproject.com/ticket/29011> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/050.38a7300eb3b585ac928cc67e87c05981%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.