#10427: Bound field needs an easy way to get form value
------------------------------+---------------------------------------------
Reporter: toxik | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: SVN
Keywords: form field value | Stage: Unreviewed
Has_patch: 1 |
------------------------------+---------------------------------------------
When you want to render your own forms in templates, without any sort of
widgetery, you bump into an issue: it is impossible to get the actual
value of a field in a succinct and clean way.
Looking at Django's code for figuring this out, it clearly is a non-
trivial task, and one you can easily get wrong.
So, to remedy this, I suggest adding a `value` attribute to `BoundField`,
which simply returns that exact value. This could be used in templates
like so:
{{{
#!jinja
<input type="text" name="{{ form.username.name }}" value="{{
form.username.value }}">
}}}
I for one find this both intuitive and readable.
--
Ticket URL: <http://code.djangoproject.com/ticket/10427>
Django <http://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 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---