Skip to content

info.registration

Overview

Model registration for the meta-info API, mapping models to serializers and viewsets.

get_all_registrations

Get all the registrations.

:return: All the registrations.

Signature

get_all_registrations()

Source

server/vueda/info/registration.py:154

get_registered_content_types

Get all the registered content types.

:return: All the registered content types.

Signature

get_registered_content_types()

Source

server/vueda/info/registration.py:164

get_registration

Get the registration for a content type.

:param content_type: The content type to get the registration for. :return: The registration for the content type.

Signature

get_registration(content_type)

Parameters

NameTypeRequiredDescription
content_typeyes

Source

server/vueda/info/registration.py:121

get_serializer_for_model

Return the canonical serializer class registered for model, or None if the model has not been registered. Uses the in-process registry directly, avoiding the ContentType database query required by :func:get_registration.

Signature

get_serializer_for_model(model)

Parameters

NameTypeRequiredDescription
modelyes

Source

server/vueda/info/registration.py:143

register

Register a model so that it can be used with ModelInfoViewSet. You should do this in the ready method of an AppConfig, not as a side effect of importing viewsets or serializers.

:param canonical_serializer: The serializer to use as a reference for the model. Only a Meta.model is required; it does not need to inherit VuedaSerializer. The /info/ meta-API falls back to defaults for any VuedaExpandableFieldsSerializerMixin hooks (generate_expand_model_info, get_expand_model_info, get_field_model_info) the serializer doesn't define. :param canonical_viewset: The viewset to use as a reference for the model.

Signature

register(canonical_serializer, canonical_viewset)

Parameters

NameTypeRequiredDescription
canonical_serializeryes
canonical_viewsetyes

Source

server/vueda/info/registration.py:24

register_serializer

Register a model so that it can be used with ModelInfoViewSet. You should do this in the ready method of an AppConfig, not as a side effect of importing viewsets or serializers.

Because there is no viewset, the info available will be limited to

:param canonical_serializer: The serializer to use as a reference for the model. Only a Meta.model is required; it does not need to inherit VuedaSerializer. The /info/ meta-API falls back to defaults for any VuedaExpandableFieldsSerializerMixin hooks (generate_expand_model_info, get_expand_model_info, get_field_model_info) the serializer doesn't define.

Signature

register_serializer(canonical_serializer)

Parameters

NameTypeRequiredDescription
canonical_serializeryes

Source

server/vueda/info/registration.py:75

Source

server/vueda/info/registration.py

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2