You can use serializers to use validation and serialization on an specific field data.
Base class for all the serializer classes. A serializer is a class that is responsible for serializing/de-serializing a value for an specific field of a document that specified by user in document class.
Parameters: |
|
---|
This exception will raise if any necessary methods does not override in subclasses.
This exception will raise in case of any validation problem.
The default value specified by user.
De-serialize the given value
Return True if _required set to true.
Check the value against current serializer policy. The difference between this method and validate method is that this method just check value to possiblity of a valid value. But validate check other parameter too like field requirement.
Serialize the given value.
Validate the value parameter against current serializer policy and riase :py:exception: ~djamo.serializers.Serializer.ValidationError if value was not valid.
Serializer for string data.
Parameters: |
|
---|
De-serialize the given value
Check the value against current serializer policy. The difference between this method and validate method is that this method just check value to possiblity of a valid value. But validate check other parameter too like field requirement.
Serialize the given value.
cast the given value to unicode
Check for a valid string in given value
Serializer for Integer data.
Parameters: |
|
---|
De-serialize the given value
Check the value against current serializer policy. The difference between this method and validate method is that this method just check value to possiblity of a valid value. But validate check other parameter too like field requirement.
Serialize the given value.
Check for a valid integer in given value
Serializer for Long data.
Parameters: |
|
---|
Serializer for a list of data.
De-serialize the given value
Check the value against current serializer policy. The difference between this method and validate method is that this method just check value to possiblity of a valid value. But validate check other parameter too like field requirement.
Serialize the given value.
Validate the value parameter against current serializer policy and riase :py:exception: ~djamo.serializers.Serializer.ValidationError if value was not valid.
Serializer for Django users, This class will de-serialize the data from the database to a django user and serialize the user normally to its user id.
Restore the string to Djano User.
Convert the Django User instance to an string.
Check for a valid Django user in given value