onadata.apps.api.viewsets.organization_profile_viewset module

Module contents

The /api/v1/orgs API implementation

List, Retrieve, Update, Create/Register Organizations.

class onadata.apps.api.viewsets.organization_profile_viewset.OrganizationProfileViewSet(**kwargs)

Bases: AuthenticateHeaderMixin, CacheControlMixin, ETagsMixin, ObjectLookupMixin, DefaultBaseViewset, ModelViewSet

List, Retrieve, Update, Create/Register Organizations.

create(request, *args, **kwargs)

Create and cache organization

destroy(request, *args, **kwargs)

Clear cache and destroy organization

filter_backends = (<class 'onadata.libs.filters.OrganizationPermissionFilter'>, <class 'onadata.libs.filters.OrganizationsSharedWithUserFilter'>)
lookup_field = 'user'
members(request, *args, **kwargs)

Return organization members.

permission_classes = [<class 'onadata.apps.api.permissions.OrganizationProfilePermissions'>]
queryset
retrieve(request, *args, **kwargs)

Get organization from cache or db

serializer_class

alias of OrganizationSerializer

update(request, *args, **kwargs)

Update org in cache and db

onadata.apps.api.viewsets.organization_profile_viewset.serializer_from_settings()

Return the OrganizationSerializer either from settings or the default.