Commit f8dbb4e9 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

allow page as query param by default

parent 191075f1
Pipeline #18597 passed with stages
in 2 minutes and 21 seconds
from marshmallow import Schema, fields
class PaginatedQueryParams(Schema):
page = fields.Integer()
from marshmallow import Schema
class EmptyQueryParams(Schema):
pass
from marshmallow import Schema, fields
from marshmallow import fields
from .base import PaginatedQueryParams
class FunctionQueryParams(Schema):
class FunctionQueryParams(PaginatedQueryParams):
detailed = fields.Boolean()
from marshmallow import Schema, fields
from marshmallow import fields
from .base import PaginatedQueryParams
class TaxonomyQueryParams(Schema):
class TaxonomyQueryParams(PaginatedQueryParams):
rank = fields.String()
name = fields.String()
......@@ -3,11 +3,11 @@ from rest_framework import status
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from metagenedb.api.catalog.qparams_validators.empty import EmptyQueryParams
from metagenedb.api.catalog.qparams_validators.base import PaginatedQueryParams
class BulkViewSet(ModelViewSet):
query_params_parser = EmptyQueryParams
query_params_parser = PaginatedQueryParams
def get_objects(self, instance_ids):
return self.queryset.in_bulk(instance_ids, field_name=self.lookup_field)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment