If set, this gives the default value that will be used for the field if none is supplied. If not set the default behavior is to not populate the attribute at all.
If set, this gives the default value that will be used for the field if none is supplied. If not set the default behavior is to not populate the attribute at all.
May be set to a function or other callable, in which case the value will be evaluated each time it is used.
### `validators`
### `validators`
A list of Django validators that should be used to validate deserialized values.
A list of Django validators that should be used to validate deserialized values.
@@ -43,6 +43,7 @@ You can determine your currently installed version using `pip freeze`:
...
@@ -43,6 +43,7 @@ You can determine your currently installed version using `pip freeze`:
### Master
### Master
*Added `get_url` hook to `HyperlinkedIdentityField`.
*Added `get_url` hook to `HyperlinkedIdentityField`.
*Serializer field `default` argument may be a callable.
*Bugfix:The `lookup_field` option on `HyperlinkedIdentityField` should apply by default to the url field on the serializer.
*Bugfix:The `lookup_field` option on `HyperlinkedIdentityField` should apply by default to the url field on the serializer.
*Bugfix:`HyperlinkedIdentityField` should continue to support `pk_url_kwarg`, `slug_url_kwarg`, `slug_field`, in a pending deprecation state.
*Bugfix:`HyperlinkedIdentityField` should continue to support `pk_url_kwarg`, `slug_url_kwarg`, `slug_field`, in a pending deprecation state.
*Bugfix:Ensure we always return 404 instead of 500 if a lookup field cannot be converted to the correct lookup type. (Eg non-numeric `AutoInteger` pk lookup)
*Bugfix:Ensure we always return 404 instead of 500 if a lookup field cannot be converted to the correct lookup type. (Eg non-numeric `AutoInteger` pk lookup)