1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge pull request #10180 from ibrahimtok/patch-1

Update filtersets.md
This commit is contained in:
Jeremy Stretch
2022-08-29 09:35:08 -04:00
committed by GitHub

View File

@ -34,12 +34,12 @@ To utilize a filter set in a subclass of one of NetBox's generic views (such as
```python
# views.py
from netbox.views.generic import ObjectListView
from .filtersets import MyModelFitlerSet
from .filtersets import MyModelFilterSet
from .models import MyModel
class MyModelListView(ObjectListView):
queryset = MyModel.objects.all()
filterset = MyModelFitlerSet
filterset = MyModelFilterSet
```
To enable a filter set on a REST API endpoint, set the `filterset_class` attribute on the API view: