organization (certego_saas.apps.organization)

admin.py


class certego_saas.apps.organization.admin.InvitationAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

class certego_saas.apps.organization.admin.MembershipAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

class certego_saas.apps.organization.admin.OrganizationAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

mixins.py


models.py


class certego_saas.apps.organization.models.Invitation(id, created_at, user, organization, status)[source]

Bases: certego_saas.ext.models.TimestampedModel

exception AlreadyPendingException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

exception AlreadyPresentException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

exception MaxMemberException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

exception OwnerException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

exception PreviouslyAcceptedException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

exception PreviouslyDeclinedException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

class certego_saas.apps.organization.models.Membership(*args, **kwargs)[source]

Bases: certego_saas.ext.models.TimestampedModel

Inspired by: https://docs.djangoproject.com/en/3.2/topics/db/models/#extra-fields-on-many-to-many-relationships

exception ExistingMembershipException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

exception OwnerCantLeaveException(detail=None, code=None)[source]

Bases: rest_framework.exceptions.ValidationError

class certego_saas.apps.organization.models.Organization(*args, **kwargs)[source]

Bases: certego_saas.ext.models.TimestampedModel

Organization model is related to User model through the Membership model.

permissions.py


serializers.py


class certego_saas.apps.organization.serializers.InvitationsListSerializer(*args, **kwargs)[source]

Bases: rest_flex_fields.serializers.FlexFieldsModelSerializer

class certego_saas.apps.organization.serializers.InviteCreateSerializer(*args, **kwargs)[source]

Bases: rest_framework.serializers.Serializer

create(validated_data) → certego_saas.apps.organization.invitation.Invitation[source]

Create Invitation object.

class certego_saas.apps.organization.serializers.OrganizationSerializer(*args, **kwargs)[source]

Bases: rest_flex_fields.serializers.FlexFieldsModelSerializer

create(validated_data: dict) → certego_saas.apps.organization.organization.Organization[source]

Create Organization object.

views.py