onadata.apps.api.viewsets.project_viewset module

Module contents

The /projects API endpoint implementation.

class onadata.apps.api.viewsets.project_viewset.ProjectViewSet(**kwargs)

Bases: AuthenticateHeaderMixin, CacheControlMixin, ETagsMixin, LabelsMixin, ProfilerMixin, DefaultBaseViewset, ModelViewSet

List, Retrieve, Update, Create Project and Project Forms.

destroy(request, *args, **kwargs)

Soft deletes a project

extra_lookup_fields = None
filter_backends = (<class 'onadata.libs.filters.AnonUserProjectFilter'>, <class 'onadata.libs.filters.ProjectOwnerFilter'>, <class 'onadata.libs.filters.TagFilter'>)
forms(request, **kwargs)

Add a form to a project or list forms for the project.

The request key xls_file holds the XLSForm file object.

get_queryset()

Use ‘prepared’ prefetched queryset for GET requests.

get_serializer_class()

Return BaseProjectSerializer class when listing projects.

invitations(request, *args, **kwargs)

List, Create. Update project invitations

list(request, *args, **kwargs)

Returns a list of projects

lookup_field = 'pk'
pagination_class

alias of StandardPageNumberPagination

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

Resend a project invitation object

retrieve(request, *args, **kwargs)

Retrieve single project

revoke_invitation(request, *args, **kwargs)

Revoke a project invitation object

serializer_class

alias of ProjectSerializer

share(request, *args, **kwargs)

Allow sharing of a project to a user.

star(request, *args, **kwargs)

Allows to add a user that stars a project.

update(request, *args, **kwargs)

Updates project properties and set’s cache with the updated records.