class documentation

class ListSerializer(BaseSerializer): (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method __repr__ Fields are represented using their initial calling arguments. This allows us to create descriptive representations for serializer instances that show all the declared fields on the serializer.
Method create Undocumented
Method get_initial Return a value to use when the field is being returned as a primitive value, without any object instance.
Method get_value Given the input dictionary, return the field value.
Method is_valid Undocumented
Method run_validation We override the default `run_validation`, because the validation performed by validators and the `.validate()` method should be coerced into an error dictionary with a 'non_fields_error' key.
Method save Save and return a list of object instances.
Method to_internal_value List of dicts of native values <- List of dicts of primitive datatypes.
Method to_representation List of object instances -> List of dicts of primitive datatypes.
Method update Undocumented
Method validate Undocumented
Class Variable default_error_messages Undocumented
Class Variable many Undocumented
Instance Variable allow_empty Undocumented
Instance Variable child Undocumented
Instance Variable instance Undocumented
Instance Variable max_length Undocumented
Instance Variable min_length Undocumented
Property data Undocumented
Property errors Undocumented
Instance Variable _validated_data Undocumented

Inherited from BaseSerializer:

Class Method many_init This method implements the creation of a `ListSerializer` parent class when `many=True` is used. You can customize it if you need to control which keyword arguments are passed to the parent, and which are passed to the child.
Method __class_getitem__ Undocumented
Method __new__ When a field is instantiated, we store the arguments that were used, so that we can present a helpful representation of the object.
Instance Variable initial_data Undocumented
Instance Variable partial Undocumented
Property validated_data Undocumented
Instance Variable _context Undocumented

Inherited from Field (via BaseSerializer):

Method __deepcopy__ When cloning fields we instantiate using the arguments it was originally created with, rather than copying the complete state.
Method bind Initializes the field name and parent for the field instance. Called when a field is added to the parent serializer instance.
Method fail A helper method that simply raises a validation error.
Method get_attribute Given the *outgoing* object instance, return the primitive value that should be used for this field.
Method get_default Return the default value to use when validating data if no input is provided for this field.
Method get_validators Undocumented
Method run_validators Test the given value against all the validators on the field, and either raise a `ValidationError` or simply return.
Method validate_empty_values Validate empty values, and either:
Method validators.setter Undocumented
Class Variable default_validators Undocumented
Instance Variable allow_null Undocumented
Instance Variable default Undocumented
Instance Variable default_empty_html Undocumented
Instance Variable error_messages Undocumented
Instance Variable field_name Undocumented
Instance Variable help_text Undocumented
Instance Variable initial Undocumented
Instance Variable label Undocumented
Instance Variable parent Undocumented
Instance Variable read_only Undocumented
Instance Variable required Undocumented
Instance Variable source Undocumented
Instance Variable source_attrs Undocumented
Instance Variable style Undocumented
Instance Variable write_only Undocumented
Property context Returns the context as passed to the root serializer on initialization.
Property root Returns the top-level serializer for this field.
Property validators Undocumented
Instance Variable _creation_counter Undocumented
Instance Variable _validators Undocumented
def __init__(self, *args, **kwargs): (source)
def __repr__(self): (source)

Fields are represented using their initial calling arguments. This allows us to create descriptive representations for serializer instances that show all the declared fields on the serializer.

def create(self, validated_data): (source)
def get_initial(self): (source)

Return a value to use when the field is being returned as a primitive value, without any object instance.

def get_value(self, dictionary): (source)

Given the input dictionary, return the field value.

def is_valid(self, *, raise_exception=False): (source)
def run_validation(self, data=empty): (source)

We override the default `run_validation`, because the validation performed by validators and the `.validate()` method should be coerced into an error dictionary with a 'non_fields_error' key.

def save(self, **kwargs): (source)

Save and return a list of object instances.

def to_internal_value(self, data): (source)

List of dicts of native values <- List of dicts of primitive datatypes.

def to_representation(self, data): (source)

List of object instances -> List of dicts of primitive datatypes.

def update(self, instance, validated_data): (source)
def validate(self, attrs): (source)

Undocumented

default_error_messages = (source)

Undocumented

allow_empty = (source)

Undocumented

Undocumented

max_length = (source)

Undocumented

min_length = (source)

Undocumented