Skip to content
Snippets Groups Projects
Commit 948b8fcf authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Clean-up field names.

parent eb879034
No related branches found
No related tags found
No related merge requests found
......@@ -155,13 +155,9 @@ class UserSerializer(serializers.ModelSerializer):
class CategorySerializer(serializers.ModelSerializer):
# TODO: remove this when the dashboard is updated
category = serializers.CharField(source="name")
class Meta:
model = Category
# TODO: replace `category` with `name` when the dashboard is updated
fields = ("id", "category", "subtitle", "slug", "is_active", "description")
fields = ("id", "name", "subtitle", "slug", "is_active", "description")
class HostLinkSerializer(serializers.ModelSerializer):
......@@ -231,43 +227,27 @@ class LanguageSerializer(serializers.ModelSerializer):
class TopicSerializer(serializers.ModelSerializer):
# TODO: remove this when the dashboard is updated
topic = serializers.CharField(source="name")
class Meta:
model = Topic
# TODO: replace `topic` with `name` when the dashboard is updated
fields = ("id", "topic", "slug", "is_active")
fields = ("id", "name", "slug", "is_active")
class MusicFocusSerializer(serializers.ModelSerializer):
# TODO: remove this when the dashboard is updated
focus = serializers.CharField(source="name")
class Meta:
model = MusicFocus
# TODO: replace `focus` with `name` when the dashboard is updated
fields = ("id", "focus", "slug", "is_active")
fields = ("id", "name", "slug", "is_active")
class TypeSerializer(serializers.ModelSerializer):
# TODO: remove this when the dashboard is updated
type = serializers.CharField(source="name")
class Meta:
model = Type
# TODO: replace `type` with `name` when the dashboard is updated
fields = ("id", "type", "slug", "is_active")
fields = ("id", "name", "slug", "is_active")
class FundingCategorySerializer(serializers.ModelSerializer):
# TODO: remove this when the dashboard is updated
fundingcategory = serializers.CharField(source="name")
class Meta:
model = FundingCategory
# TODO: replace `fundingcategory` with `name` when the dashboard is updated
fields = ("id", "fundingcategory", "slug", "is_active")
fields = ("id", "name", "slug", "is_active")
class ShowLinkSerializer(serializers.ModelSerializer):
......@@ -287,16 +267,12 @@ class ShowSerializer(serializers.HyperlinkedModelSerializer):
queryset=Language.objects.all(), many=True
)
topic = serializers.PrimaryKeyRelatedField(queryset=Topic.objects.all(), many=True)
# TODO: replace `musicfocs` with `music_focus` and remove the source when the dashboard is
# updated
musicfocus = serializers.PrimaryKeyRelatedField(
queryset=MusicFocus.objects.all(), source="music_focus", many=True
music_focus = serializers.PrimaryKeyRelatedField(
queryset=MusicFocus.objects.all(), many=True
)
type = serializers.PrimaryKeyRelatedField(queryset=Type.objects.all())
# TODO: replace `fundingcategory` with `funding_category` and remove the source when the
# dashboard is updated
fundingcategory = serializers.PrimaryKeyRelatedField(
queryset=FundingCategory.objects.all(), source="funding_category"
funding_category = serializers.PrimaryKeyRelatedField(
queryset=FundingCategory.objects.all()
)
predecessor = serializers.PrimaryKeyRelatedField(
queryset=Show.objects.all(), required=False, allow_null=True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment