Skip to content

Commit

Permalink
More verbose __str__()
Browse files Browse the repository at this point in the history
  • Loading branch information
aapris committed Nov 17, 2024
1 parent 6bc2766 commit 629db72
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion django_server/application_evaluator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,22 @@ class Score(EvaluationModel):
criterion = models.ForeignKey(Criterion, related_name="scores", on_delete=models.CASCADE)

def __str__(self):
return f"Score(score={self.score}, application={self.application_id}, criterion={self.criterion_id})"
return (
f"Score(user={self.evaluator.username} score={self.score}, application={self.application_id}, "
f"criterion={self.criterion_id})"
)


class Comment(EvaluationModel):
comment = models.TextField(blank=True)
criterion_group = models.ForeignKey(CriterionGroup, related_name="comments", on_delete=models.CASCADE)

def __str__(self):
return (
f"Comment(user={self.evaluator.username}, application={self.application_id}, "
f"group={self.criterion_group_id})"
)


class ApplicationRoundSubmittal(Model):
application_round = models.ForeignKey(ApplicationRound, related_name="submittals", on_delete=models.CASCADE)
Expand Down

0 comments on commit 629db72

Please sign in to comment.