Skip to content

Commit

Permalink
fix: use RelationsFilterSet instead of GenericFilterSet
Browse files Browse the repository at this point in the history
  • Loading branch information
gythaogg committed Nov 14, 2024
1 parent 7f8febb commit 4da62fb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apis_ontology/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
)
from apis_core.apis_entities.models import RootObject
from apis_core.generic.filtersets import GenericFilterSet
from apis_core.relations.filtersets import RelationFilterSet
from apis_core.relations.models import Relation
from django.apps import apps
from django.db import models

from apis_ontology.forms import (
PersonSearchForm,
PlaceSearchForm,
TibScholRelationMixinForm,
TibScholRelationMixinSearchForm,
WorkSearchForm,
)
from apis_ontology.models import Instance, Person, Place, Work
Expand Down Expand Up @@ -93,10 +92,9 @@ class Meta(AbstractEntityFilterSet.Meta):
}


class TibScholRelationMixinFilterSet(GenericFilterSet):
class Meta(GenericFilterSet.Meta):
form = TibScholRelationMixinSearchForm
exclude = ABSTRACT_ENTITY_FILTERS_EXCLUDE
class TibScholRelationMixinFilterSet(RelationFilterSet):
class Meta(RelationFilterSet.Meta):
exclude = RelationFilterSet.Meta.exclude + ABSTRACT_ENTITY_FILTERS_EXCLUDE
filter_overrides = {
models.CharField: {
"filter_class": django_filters.CharFilter,
Expand Down

0 comments on commit 4da62fb

Please sign in to comment.