progress bar
This commit is contained in:
@@ -30,6 +30,12 @@ class Solution(models.Model):
|
||||
models.Index(fields=['set', '-time_sent']),
|
||||
]
|
||||
|
||||
@property
|
||||
def percentage_done(self):
|
||||
if self.test is None:
|
||||
return 0
|
||||
return self.test * 100 // self.task.tests_count
|
||||
|
||||
@property
|
||||
def language(self):
|
||||
return languages[self.language_id]
|
||||
|
Reference in New Issue
Block a user