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

Clean code

parent 0b93bd25
......@@ -8,7 +8,6 @@ class BulkViewSet(ModelViewSet):
def get_objects(self, instance_ids):
return self.queryset.in_bulk(instance_ids, field_name=self.lookup_field)
def _created_payload(self, serializer, request):
if isinstance(request.data, list):
return {
......@@ -38,12 +37,10 @@ class BulkViewSet(ModelViewSet):
# perform the classic update
return super().update(request, *args, **kwargs)
instance_ids = set([element[self.lookup_field] for element in request.data])
instances_set = self.get_objects(instance_ids)
instances = [instance for instance in instances_set.values()]
serializer = self.get_serializer(instances, data=request.data, many=True)
instances = self.get_objects(instance_ids)
serializer = self.get_serializer(instances.values(), data=request.data, many=True)
serializer.is_valid(raise_exception=True)
# instance = self.get_object()
# serializer = self.get_serializer(instance, data=request.data, partial=partial)
# serializer.is_valid(raise_exception=True)
......
......@@ -6,7 +6,6 @@ from rest_framework.utils import model_meta
from metagenedb.apps.catalog.models import Function, Gene, Taxonomy
from metagenedb.apps.catalog.serializers import FunctionSerializer
logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
......
import logging
logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
......
import logging
logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
......
import logging
logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
......
......@@ -10,7 +10,6 @@ from slugify import slugify
from metagenedb.common.utils.parsers import IGCLineParser
logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
......
......@@ -15,7 +15,6 @@ django.setup()
from metagenedb.apps.catalog.models import Taxonomy # noqa
from metagenedb.apps.catalog.serializers import TaxonomySerializer # noqa
logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
SELECT_RELATED_PARENT = "parent{}".format("__parent" * 40)
......
......@@ -18,7 +18,6 @@ django.setup()
from metagenedb.apps.catalog.models import KeggOrthology # noqa
logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
KEGG_KO_LIST_API = "http://rest.kegg.jp/list/ko"
......
Markdown is supported
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