#19700 closed New feature (fixed)
BoundField documentation: original field
Reported by: | tga | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Please add in the documentation a mention on how to get the original field of a BoundField.
Locations:
https://docs.djangoproject.com/en/dev/topics/forms/#looping-over-the-form-s-fields
https://docs.djangoproject.com/en/dev/ref/forms/api/#django.forms.BoundField
In these two locations it would be very useful to have a mention like:
--
{{ field.field }}
The original field instance, as added to the form object, e.g. a forms.CharField instance.
--
Details:
When adding field programatically to a form, it comes naturally to want to add extra fields to that object and then read them back in the template. However, as the docs clearly state, iterating over a (bound) form returns BoundFields instead of the original Field objects put into the form. There is no mention in the docs how to get to the original field instance in the template.
Cheers!
Change History (4)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Created pull request: https://github.com/django/django/pull/685