onadata.libs.serializers.fields package

Submodules

onadata.libs.serializers.fields.hyperlinked_multi_identity_field module

The HyperlinkedIdentityField class - multi-lookup identity fields.

class onadata.libs.serializers.fields.hyperlinked_multi_identity_field.HyperlinkedMultiIdentityField(*args, **kwargs)

Bases: HyperlinkedIdentityField

The HyperlinkedIdentityField class - multi-lookup identity fields.

get_url(obj, view_name, request, format)

Given an object, return the URL that hyperlinks to the object.

May raise a NoReverseMatch if the view_name and lookup_field attributes are not configured to correctly match the URL conf.

lookup_fields = (('pk', 'pk'),)

onadata.libs.serializers.fields.json_field module

A string is represented as valid JSON and is accessible as a dictionary and vis-a-vis.

class onadata.libs.serializers.fields.json_field.JsonField(*args, **kwargs)

Bases: Field

Deserialize a string instance containing a JSON document to a Python object.

to_internal_value(data)

Deserialize value a str instance containing a JSON document to a Python object.

classmethod to_json(data)

Returns the JSON string as a dictionary.

to_representation(value)

Deserialize value a str instance containing a JSON document to a Python object.

onadata.libs.serializers.fields.organization_field module

OrganizationField serializer field.

class onadata.libs.serializers.fields.organization_field.OrganizationField(*args, **kwargs)

Bases: Field

organization serializer field

to_internal_value(data)

Validate the organization exists.

to_representation(value)

Return the organization pk.

onadata.libs.serializers.fields.project_field module

ProjectField serializer field.

class onadata.libs.serializers.fields.project_field.ProjectField(*args, **kwargs)

Bases: Field

Project field for use with a Project object/instance.

to_internal_value(data)

Validates that a project exists.

to_representation(value)

Returns the project pk.

onadata.libs.serializers.fields.team_field module

The TeamField class.

class onadata.libs.serializers.fields.team_field.TeamField(*args, **kwargs)

Bases: Field

The TeamField class.

to_internal_value(data)

Transform the incoming primitive data into a native value.

to_representation(value)

Transform the outgoing native value into primitive data.

onadata.libs.serializers.fields.xform_field module

The XFormField class

class onadata.libs.serializers.fields.xform_field.XFormField(*args, **kwargs)

Bases: Field

The XFormField class

to_internal_value(data)

Transform the incoming primitive data into a native value.

to_representation(value)

Transform the outgoing native value into primitive data.

Module contents