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

Explicit field names are better tha implicit ones.

parent 948b8fcf
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,17 @@ class HostSerializer(serializers.ModelSerializer):
class Meta:
model = Host
fields = "__all__"
fields = (
"name",
"email",
"website",
"biography",
"image",
"height",
"width",
"ppoi",
"is_active",
)
def create(self, validated_data):
links_data = validated_data.pop("links", [])
......@@ -404,7 +414,19 @@ class ShowSerializer(serializers.HyperlinkedModelSerializer):
class ScheduleSerializer(serializers.ModelSerializer):
class Meta:
model = Schedule
fields = "__all__"
fields = (
"rrule",
"show",
"by_weekday",
"first_date",
"last_date",
"start_time",
"end_time",
"is_repetition",
"add_days_no",
"add_business_days_only",
"default_playlist_id",
)
class UnsavedScheduleSerializer(ScheduleSerializer):
......@@ -424,7 +446,19 @@ class ScheduleInRequestSerializer(ScheduleSerializer):
class Meta:
model = Schedule
fields = "__all__"
fields = (
"rrule",
"show",
"by_weekday",
"first_date",
"last_date",
"start_time",
"end_time",
"is_repetition",
"add_days_no",
"add_business_days_only",
"default_playlist_id",
)
def create(self, validated_data):
"""Create and return a new Schedule instance, given the validated data."""
......@@ -535,7 +569,16 @@ class TimeSlotSerializer(serializers.ModelSerializer):
class Meta:
model = TimeSlot
fields = "__all__"
fields = (
"schedule",
"show",
"start",
"end",
"memo",
"is_repetition",
"playlist_id",
"note_id",
)
def create(self, validated_data):
"""Create and return a new TimeSlot instance, given the validated data."""
......@@ -580,7 +623,23 @@ class NoteSerializer(serializers.ModelSerializer):
class Meta:
model = Note
fields = "__all__"
fields = (
"timeslot",
"show",
"user",
"host",
"title",
"slug",
"summary",
"content",
"image",
"width",
"height",
"ppoi",
"status",
"start",
"cba_id",
)
def create(self, validated_data):
"""Create and return a new Note instance, given the validated data."""
......
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