beat.web.common.api module

class beat.web.common.api.CheckContributionNameView(**kwargs)[source]

Bases: beat.web.common.mixins.CommonContextMixin, rest_framework.generics.CreateAPIView

serializer_class

alias of beat.web.common.serializers.CheckNameSerializer

permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
get_serializer_context()[source]

Extra context provided to the serializer class.

post(request)[source]
class beat.web.common.api.ShareView(**kwargs)[source]

Bases: beat.web.common.mixins.CommonContextMixin, rest_framework.generics.CreateAPIView

permission_classes = [<class 'beat.web.common.permissions.IsAuthor'>]
serializer_class

alias of beat.web.common.serializers.SharingSerializer

get_queryset()[source]

Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.

This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.

You may want to override this if you need to provide different querysets depending on the incoming request.

(Eg. return a list of items that is specific to the user)

do_share(obj, data)[source]
post(request, *args, **kwargs)[source]
class beat.web.common.api.ListContributionView(**kwargs)[source]

Bases: beat.web.common.mixins.CommonContextMixin, beat.web.common.mixins.SerializerFieldsMixin, rest_framework.generics.ListAPIView

model

alias of beat.web.common.models.Contribution

serializer_class

alias of beat.web.common.serializers.ContributionSerializer

permission_classes = [<class 'rest_framework.permissions.AllowAny'>]
get_queryset()[source]

Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.

This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.

You may want to override this if you need to provide different querysets depending on the incoming request.

(Eg. return a list of items that is specific to the user)

get(request, *args, **kwargs)[source]
class beat.web.common.api.ListCreateBaseView(**kwargs)[source]

Bases: beat.web.common.mixins.CommonContextMixin, beat.web.common.mixins.SerializerFieldsMixin, rest_framework.generics.ListCreateAPIView

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

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

get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]
class beat.web.common.api.ListCreateContributionView(**kwargs)[source]

Bases: beat.web.common.api.ListCreateBaseView

permission_classes = [<class 'beat.web.common.permissions.IsAuthorOrReadOnly'>]
get_queryset()[source]

Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.

This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.

You may want to override this if you need to provide different querysets depending on the incoming request.

(Eg. return a list of items that is specific to the user)

class beat.web.common.api.DiffView(**kwargs)[source]

Bases: rest_framework.generics.RetrieveAPIView

model

alias of beat.web.common.models.Versionable

serializer_class

alias of beat.web.common.serializers.DiffSerializer

get(request, author1, name1, version1, author2, name2, version2)[source]
class beat.web.common.api.RetrieveUpdateDestroyContributionView(**kwargs)[source]

Bases: beat.web.common.mixins.CommonContextMixin, beat.web.common.mixins.SerializerFieldsMixin, rest_framework.generics.RetrieveUpdateDestroyAPIView

model

alias of beat.web.common.models.Contribution

permission_classes = [<class 'beat.web.common.permissions.IsAuthorOrReadOnly'>, <class 'beat.web.common.permissions.IsModifiableOrRead'>]
get_serializer(*args, **kwargs)[source]

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

get_object()[source]

Returns the object the view is displaying.

You may want to override this if you need to provide non-standard queryset lookups. Eg if objects are referenced using multiple keyword arguments in the url conf.

get(request, *args, **kwargs)[source]
perform_destroy(instance)[source]