Skip to content

legacy_view#

LegacyDatasetFilter#

Bases: FilterSet

Source code in src/apps/core/views/legacy_view.py
class LegacyDatasetFilter(filters.FilterSet):
    dataset_json__research_dataset__title = filters.CharFilter(
        lookup_expr="icontains",
        label="Research Dataset Title",
        max_length=512,
    )
    dataset_json__data_catalog__identifier = filters.CharFilter(
        lookup_expr="icontains",
        label="Data Catalog Identifier",
        max_length=512,
    )

LegacyDatasetViewSet#

Bases: CommonModelViewSet

Source code in src/apps/core/views/legacy_view.py
class LegacyDatasetViewSet(CommonModelViewSet):
    serializer_class = LegacyDatasetModelSerializer
    queryset = LegacyDataset.available_objects.all().prefetch_related(
        "dataset__access_rights__license",
        "dataset__access_rights",
        "dataset__actors",
    )
    filterset_class = LegacyDatasetFilter
    access_policy = LegacyDatasetAccessPolicy

    def get_queryset(self):
        qs = super().get_queryset()
        return LegacyDatasetAccessPolicy.scope_queryset(self.request, qs)