beat.web.team.api module

class beat.web.team.api.UserTeamListView(**kwargs)[source]

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

Lists the team from a user and create new teams

model

alias of beat.web.team.models.Team

serializer_class

alias of beat.web.team.serializers.SimpleTeamSerializer

writing_serializer_class

alias of beat.web.team.serializers.TeamCreationSerializer

permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
get_serializer(*args, **kwargs)[source]

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

list(request, owner_name)[source]
class beat.web.team.api.TeamDetailView(**kwargs)[source]

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

This view provides the details of a team

model

alias of beat.web.team.models.Team

serializer_class

alias of beat.web.team.serializers.FullTeamSerializer

writing_serializer_class

alias of beat.web.team.serializers.TeamUpdateSerializer

get_permissions()[source]

Instantiates and returns the list of permissions that this view requires.

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_serializer(*args, **kwargs)[source]

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

get_serializer_context()[source]

Extra context provided to the serializer class.

perform_destroy(instance)[source]
update(request, owner_name, team_name)[source]
class beat.web.team.api.TeamListView(**kwargs)[source]

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

List all teams of the caller

model

alias of beat.web.team.models.Team

serializer_class

alias of beat.web.team.serializers.SimpleTeamSerializer

permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>]
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)