From 9bbccee496780e4fc8a3f1ca2e96de1bc4f34b82 Mon Sep 17 00:00:00 2001 From: Yuvi Panda Date: Tue, 26 Nov 2024 00:13:17 -0800 Subject: [PATCH] Revert "Provide more useful str representations for models" --- frx_challenges/web/models.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frx_challenges/web/models.py b/frx_challenges/web/models.py index 137af2a..f7c1ca8 100644 --- a/frx_challenges/web/models.py +++ b/frx_challenges/web/models.py @@ -24,9 +24,6 @@ class Submission(models.Model): created_at = models.DateTimeField(auto_now_add=True) last_updated = models.DateTimeField(auto_now=True) - def __str__(self): - return f"name:{self.name} user:{self.user.username}" - @property def best_version(self) -> Version: """ @@ -111,7 +108,7 @@ def latest_evaluation(self) -> Evaluation | None: return None def __str__(self): - return f"file:{self.filename} submission:{self.submission.name} user:{self.user.username}" + return f"({self.status}) {self.data_uri}" class Evaluation(models.Model): @@ -148,7 +145,7 @@ def ordered_results(self) -> list: return results_list def __str__(self): - return f"submission:{self.version.submission.name} version:{self.version.id} id:{self.id} status:{self.status}" + return f"({self.status}) {self.result} {self.version.data_uri}" class Collaborator(models.Model): @@ -160,9 +157,6 @@ class Collaborator(models.Model): submission = models.ForeignKey(Submission, on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE) - def __str__(self): - return f"submission:{self.submission.name} user:{self.user.username}" - class Meta: # A user can be added as a collaborator only once unique_together = ("user", "submission")