Skip to content

Commit

Permalink
view for pipelines, not UI
Browse files Browse the repository at this point in the history
  • Loading branch information
adRn-s committed Oct 29, 2024
1 parent 238d419 commit 66ced41
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/library_sample_shared/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
)


class OrganismFullSerializer(ModelSerializer):
class Meta:
model = Organism
fields = '__all__'


class OrganismSerializer(ModelSerializer):
class Meta:
model = Organism
Expand Down
8 changes: 8 additions & 0 deletions backend/library_sample_shared/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
IndexTypeSerializer,
LibraryProtocolSerializer,
LibraryTypeSerializer,
OrganismFullSerializer,
OrganismSerializer,
ReadLengthSerializer,
)
Expand Down Expand Up @@ -64,6 +65,13 @@ def _get_data(self, serializer):
return data


class OrganismFullViewSet(MoveOtherMixin, viewsets.ReadOnlyModelViewSet):
"""Get the list of organisms with all of their fields. To be used by pipelines instead of UI"""

queryset = Organism.objects.order_by("name")
serializer_class = OrganismFullSerializer


class OrganismViewSet(MoveOtherMixin, viewsets.ReadOnlyModelViewSet):
"""Get the list of organisms."""

Expand Down
2 changes: 2 additions & 0 deletions backend/wui/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
LibraryProtocolInvoicingViewSet,
LibraryProtocolViewSet,
LibraryTypeViewSet,
OrganismFullViewSet,
OrganismViewSet,
ReadLengthInvoicingViewSet,
ReadLengthViewSet,
Expand All @@ -43,6 +44,7 @@
router.register(r"requests", RequestViewSet, basename="request")
router.register(r"approve", ApproveViewSet, basename="approve")
router.register(r"cost_units", CostUnitsViewSet, basename="cost-units")
router.register(r"organisms_full", OrganismFullViewSet, basename="organism-full")
router.register(r"organisms", OrganismViewSet, basename="organism")
router.register(r"read_lengths", ReadLengthViewSet, basename="read-length")
router.register(
Expand Down

0 comments on commit 66ced41

Please sign in to comment.