I want to find the corresponding filter class or viewset class only through Model.
The corresponding Model can be found by filter class or viewset class, but it cannot be reversed. I have a naming of these three, there is a rule, I guess it can be found through the string name of the filter class or viewset class, but it can not be achieved
class Manager(models.Model)
class ManagerFilter(filters.FilterSet):
class Meta:
model = Manager
fields = {'name': ['exact', 'in', 'startswith']}
class ManagerViewSet(viewsets.ModelViewSet):
filter_class = ManagerFilter
I can only get the Model class, I want to get the corresponding filter class or viewset class according to this Model.