beat.web.search.api module¶
-
class
beat.web.search.api.SearchView(**kwargs)[source]¶ Bases:
rest_framework.views.APIViewSearch endpoint
This view allows to run a search through the various elements composing the beat platform either using a query which will run a global search or by using filters that will restrict the search to the given domains.
Available filters are: ‘results’, ‘toolchains’, ‘algorithms’, ‘dataformats’, ‘databases’, ‘users’ Available options are: ‘order-by’
-
permission_classes= [<class 'rest_framework.permissions.AllowAny'>]¶
-
FILTER_IEXACT= 0¶
-
FILTER_ICONTAINS= 1¶
-
FILTER_ISTARTSWITH= 2¶
-
FILTER_IENDSWITH= 3¶
-
-
class
beat.web.search.api.SearchSaveView(**kwargs)[source]¶ Bases:
beat.web.common.mixins.CommonContextMixin,beat.web.common.mixins.SerializerFieldsMixin,rest_framework.generics.CreateAPIView,rest_framework.generics.UpdateAPIViewThis endpoint allows to save and update a search query
Saving a search allows to re-run the same query later without having to redo the query/filtering which might get complex.
Note that two consecutive runs of a search might yield different results
-
model¶ alias of
beat.web.search.models.Search
-
permission_classes= [<class 'rest_framework.permissions.IsAuthenticated'>]¶
-
serializer_class¶
-
-
class
beat.web.search.api.ListSearchView(**kwargs)[source]¶ Bases:
beat.web.common.mixins.CommonContextMixin,rest_framework.generics.ListAPIViewLists all available search from a user
-
permission_classes= [<class 'rest_framework.permissions.AllowAny'>]¶
-
serializer_class¶
-
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.search.api.RetrieveDestroySearchAPIView(**kwargs)[source]¶ Bases:
beat.web.common.mixins.CommonContextMixin,beat.web.common.mixins.SerializerFieldsMixin,rest_framework.generics.RetrieveDestroyAPIViewDelete the given search
-
model¶ alias of
beat.web.search.models.Search
-
serializer_class¶
-
permission_classes= [<class 'beat.web.common.permissions.IsAuthorOrReadOnly'>]¶
-
Bases:
beat.web.common.api.ShareViewShare the given search with other users/teams
alias of
beat.web.search.models.Search
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)