Opened 14 years ago

Closed 12 years ago

#15589 closed New feature (fixed)

form's field.value not documented

Reported by: chris@… Owned by: nobody
Component: Documentation Version: 1.3-beta
Severity: Normal Keywords: Form Field Value
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

On http://docs.djangoproject.com/en/dev/topics/forms/
Section "Looping over the form's fields"

Add:
{{ field.value }}
The value of the field.

Example usage:
{% for field in form %}

{% if field.value %}

<p>{{ field.label_tag }}:{{ field.value }}</p>

{% endif %}

{% endfor %}

Change History (6)

comment:1 by Gabriel Hurley, 14 years ago

Triage Stage: UnreviewedAccepted

There are in fact several attributes and methods missing from that section about BoundField... value(), css_classes(), etc. There's also no formal definition of BoundField in the docs.

I'd like to see a reference on BoundField added to ref/forms/fields, and then link to that from the topics/forms docs. That'd be better than trying to shoehorn a bunch more material into a topic guide which isn't really about BoundField anyway.

Moreover, the change to the example suggested in the description completely changes the functionality of the example. You'd no longer be rendering a form, you'd be displaying the values. If you were going to illustrate the use of {{ field.value }} in the template there are better ways to go about it.

comment:2 by Luke Plant, 14 years ago

Type: New feature

comment:3 by Luke Plant, 14 years ago

Severity: Normal

comment:4 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 by Tim Graham, 12 years ago

Resolution: fixed
Status: newclosed

Looks like this info has been added since this ticket was created.

Note: See TracTickets for help on using tickets.
Back to Top