beat.web.databases.api module

beat.web.databases.api.database_to_json(database, request_user, fields_to_return, last_version=None)[source]
beat.web.databases.api.clean_paths(declaration)[source]
class beat.web.databases.api.ListCreateDatabasesView(**kwargs)[source]

Bases: beat.web.common.mixins.IsAdminOrReadOnlyMixin, beat.web.common.api.ListCreateBaseView

Read/Write end point that list the database available to a user and allows the creation of new databases only to platform administrator

model

alias of beat.web.databases.models.Database

serializer_class

alias of beat.web.databases.serializers.DatabaseSerializer

writing_serializer_class

alias of beat.web.databases.serializers.DatabaseCreationSerializer

namespace = 'api_databases'
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.databases.api.ListTemplatesView(**kwargs)[source]

Bases: rest_framework.views.APIView

List all templates available

permission_classes = [<class 'rest_framework.permissions.AllowAny'>]
get(request)[source]
class beat.web.databases.api.RetrieveDatabaseView(**kwargs)[source]

Bases: rest_framework.views.APIView

Returns the given database details

permission_classes = [<class 'rest_framework.permissions.AllowAny'>]
get(request, database_name, version=None)[source]