Mixins (certego_saas.ext.mixins)

class certego_saas.ext.mixins.ExportCsvAdminMixin[source]

Bases: object

Mixin class that can be used with django’s ModelAdmin.

class certego_saas.ext.mixins.RecaptchaV2Mixin(**kwargs)[source]

Bases: rest_framework.generics.GenericAPIView

Mixin that hooks the RecaptchaV2Serializer into get_serializer(). The hook is applied only if request method is POST.

get_serializer(*args, **kwargs)[source]

Return the serializer instance that should be used for validating and deserializing input, and for serializing output.

class certego_saas.ext.mixins.SerializerActionMixin(**kwargs)[source]

Bases: rest_framework.generics.GenericAPIView

Mixin that allows defining different serializer class for different view actions. Define mapping inside the class attribute serializer_action_classes (type: dict).

get_serializer_class(*args, **kwargs)[source]

Instantiate the list of serializers per action from class attribute (must be defined).