mirror of https://github.com/snachodog/mybuddy.git
Use singular form for Tag API class names
This commit is contained in:
parent
1398239ecf
commit
908d7df5e4
|
@ -202,7 +202,7 @@ class BMISerializer(CoreModelSerializer):
|
||||||
fields = ("id", "child", "bmi", "date", "notes")
|
fields = ("id", "child", "bmi", "date", "notes")
|
||||||
|
|
||||||
|
|
||||||
class TagsSerializer(serializers.HyperlinkedModelSerializer):
|
class TagSerializer(serializers.HyperlinkedModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Tag
|
model = models.Tag
|
||||||
fields = ("slug", "name", "color", "last_used")
|
fields = ("slug", "name", "color", "last_used")
|
||||||
|
|
|
@ -18,7 +18,7 @@ router.register(r"weight", views.WeightViewSet)
|
||||||
router.register(r"height", views.HeightViewSet)
|
router.register(r"height", views.HeightViewSet)
|
||||||
router.register(r"head-circumference", views.HeadCircumferenceViewSet)
|
router.register(r"head-circumference", views.HeadCircumferenceViewSet)
|
||||||
router.register(r"bmi", views.BMIViewSet)
|
router.register(r"bmi", views.BMIViewSet)
|
||||||
router.register(r"tags", views.TagsViewSet)
|
router.register(r"tags", views.TagViewSet)
|
||||||
|
|
||||||
app_name = "api"
|
app_name = "api"
|
||||||
|
|
||||||
|
|
|
@ -94,8 +94,8 @@ class BMIViewSet(viewsets.ModelViewSet):
|
||||||
filterset_fields = ("child", "date")
|
filterset_fields = ("child", "date")
|
||||||
|
|
||||||
|
|
||||||
class TagsViewSet(viewsets.ModelViewSet):
|
class TagViewSet(viewsets.ModelViewSet):
|
||||||
queryset = models.Tag.objects.all()
|
queryset = models.Tag.objects.all()
|
||||||
serializer_class = serializers.TagsSerializer
|
serializer_class = serializers.TagSerializer
|
||||||
lookup_field = "slug"
|
lookup_field = "slug"
|
||||||
filterset_fields = ("last_used", "name")
|
filterset_fields = ("last_used", "name")
|
||||||
|
|
Loading…
Reference in New Issue