Skip to content

Commit

Permalink
rename filter to filterset
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Oct 16, 2023
1 parent 6ce2d4b commit 035835d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion codeforlife/user/filters/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .user import UserFilter
from .user import UserFilterSet
2 changes: 1 addition & 1 deletion codeforlife/user/filters/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from ..models import User


class UserFilter(filters.FilterSet):
class UserFilterSet(filters.FilterSet):
student__klass = filters.CharFilter(
"new_student__class_field__access_code", "exact"
)
Expand Down
4 changes: 2 additions & 2 deletions codeforlife/user/views/user.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from rest_framework.viewsets import ModelViewSet

from ..filters import UserFilter
from ..filters import UserFilterSet
from ..models import User
from ..serializers import UserSerializer


class UserViewSet(ModelViewSet):
http_method_names = ["get", "post", "patch"]
serializer_class = UserSerializer
filterset_class = UserFilter
filterset_class = UserFilterSet

def get_queryset(self):
queryset = User.objects.all()
Expand Down

0 comments on commit 035835d

Please sign in to comment.