equal
deleted
inserted
replaced
379 def form_field_value(self, field, load_bytes=False): |
379 def form_field_value(self, field, load_bytes=False): |
380 """return field's *typed* value""" |
380 """return field's *typed* value""" |
381 myattr = '%s_%s_default' % (field.role, field.name) |
381 myattr = '%s_%s_default' % (field.role, field.name) |
382 if hasattr(self, myattr): |
382 if hasattr(self, myattr): |
383 return getattr(self, myattr)() |
383 return getattr(self, myattr)() |
|
384 if callable(value): |
|
385 value = value(self) |
384 return field.initial |
386 return field.initial |
385 |
387 |
386 def form_field_error(self, field): |
388 def form_field_error(self, field): |
387 """return validation error for widget's field, if any""" |
389 """return validation error for widget's field, if any""" |
388 if self._field_has_error(field): |
390 if self._field_has_error(field): |