Field
represents a mapping between an instance
field and a representation of the field’s data.
attribute – A string of either an instance attribute or callable of the instance.
column_name – An optional column name for the column that represents this field in the export.
widget – Defines a widget that will be used to represent this field’s data in the export, or transform the value during import.
readonly – A Boolean which defines if this field will be ignored during import.
default – This value will be returned by clean()
if this field’s widget returned a value defined in empty_values
.
saves_null_values – Controls whether null values are saved on the instance. This can be used if the widget returns null, but there is a default instance value which should not be overwritten.
dehydrate_method – You can provide a dehydrate_method as a string to use instead of the default dehydrate_{field_name} syntax, or you can provide a callable that will be executed with the instance as its argument.
m2m_add – changes save of this field to add the values, if they do not exist, to a ManyToMany field instead of setting all values. Only useful if field is a ManyToMany field.
Translates the value stored in the imported datasource to an appropriate Python object and returns it.
Returns value from the provided instance converted to export representation.
Returns method name to be used for dehydration of the field. Defaults to dehydrate_{field_name}
Returns the value of the instance’s attribute.
If this field is not declared readonly, the instance’s attribute will be set to the value returned by clean()
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4