diff --git a/api/serializers.py b/api/serializers.py index 73da3e1a..d82beaaf 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -202,7 +202,7 @@ class BMISerializer(CoreModelSerializer): fields = ("id", "child", "bmi", "date", "notes") -class TagsSerializer(serializers.HyperlinkedModelSerializer): +class TagSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = models.Tag fields = ("slug", "name", "color", "last_used") diff --git a/api/urls.py b/api/urls.py index e27c86fa..23ec934d 100644 --- a/api/urls.py +++ b/api/urls.py @@ -18,7 +18,7 @@ router.register(r"weight", views.WeightViewSet) router.register(r"height", views.HeightViewSet) router.register(r"head-circumference", views.HeadCircumferenceViewSet) router.register(r"bmi", views.BMIViewSet) -router.register(r"tags", views.TagsViewSet) +router.register(r"tags", views.TagViewSet) app_name = "api" diff --git a/api/views.py b/api/views.py index b65a2c1e..b5a81c85 100644 --- a/api/views.py +++ b/api/views.py @@ -94,8 +94,8 @@ class BMIViewSet(viewsets.ModelViewSet): filterset_fields = ("child", "date") -class TagsViewSet(viewsets.ModelViewSet): +class TagViewSet(viewsets.ModelViewSet): queryset = models.Tag.objects.all() - serializer_class = serializers.TagsSerializer + serializer_class = serializers.TagSerializer lookup_field = "slug" filterset_fields = ("last_used", "name")