Skip to content

Commit

Permalink
Reflect single submission in serializer.
Browse files Browse the repository at this point in the history
  • Loading branch information
noahbkim committed Jul 26, 2017
1 parent a84be9a commit ce04f8c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ class Meta:
fields = ('code',)


class SubmissionSerializer(serializers.ModelSerializer):
problem = ProblemSerializer()

class Meta:
model = models.Submission
fields = ('problem', 'time')


class UserSerializer(serializers.ModelSerializer):
class Meta:
model = models.User
Expand All @@ -89,17 +81,17 @@ class Meta:
fields = ('id', 'name', 'school', 'score', 'score_lastupdate', 'eligible')


class CorrectSubmissionSerializer(serializers.ModelSerializer):
class SubmissionSerializer(serializers.ModelSerializer):
problem = ProblemSerializer()
team = TeamSerializer()

class Meta:
model = models.Submission
fields = ('problem', 'team', 'new_score', 'time', 'problem', 'team')
fields = ('problem', 'team', 'new_score', 'time', 'problem', 'team', 'correct')


class TeamProfileSerializer(serializers.ModelSerializer):
solves = CorrectSubmissionSerializer(many=True, read_only=True)
solves = SubmissionSerializer(many=True, read_only=True)
members = ProfileSerializer(many=True, read_only=True)
place = serializers.SerializerMethodField()

Expand Down

0 comments on commit ce04f8c

Please sign in to comment.