MCPcopy
hub / github.com/django/django / value

Method value

django/forms/boundfield.py:140–148  ·  view source on GitHub ↗

Return the value for this BoundField, using the initial value if the form is not bound or the data otherwise.

(self)

Source from the content-addressed store, hash-verified

138 return self.form._widget_data_value(self.field.widget, self.html_name)
139
140 def value(self):
141 """
142 Return the value for this BoundField, using the initial value if
143 the form is not bound or the data otherwise.
144 """
145 data = self.initial
146 if self.form.is_bound:
147 data = self.field.bound_data(self.data, data)
148 return self.field.prepare_value(data)
149
150 def _has_changed(self):
151 field = self.field

Callers 2

subwidgetsMethod · 0.95
as_widgetMethod · 0.95

Calls 2

bound_dataMethod · 0.45
prepare_valueMethod · 0.45

Tested by

no test coverage detected