Opened 5 years ago

Closed 3 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


Section "Looping over the form's fields"

{{ 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 Changed 5 years ago by gabrielhurley

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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 Changed 5 years ago by lukeplant

  • Type set to New feature

comment:3 Changed 5 years ago by lukeplant

  • Severity set to Normal

comment:4 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 4 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:6 Changed 3 years ago by timo

  • Resolution set to fixed
  • Status changed from new to closed

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

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