mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-23 05:58:12 +08:00
Add unicode to models
This commit is contained in:
@@ -30,6 +30,9 @@ class Task(models.Model):
|
||||
def time_taken(self):
|
||||
return (self.stopped - self.started).total_seconds()
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
class Meta:
|
||||
app_label = 'django_q'
|
||||
|
||||
@@ -124,6 +127,9 @@ class Schedule(models.Model):
|
||||
if Task.objects.filter(name=self.task).exists():
|
||||
return Task.objects.get(name=self.task).success
|
||||
|
||||
def __unicode__(self):
|
||||
return self.func
|
||||
|
||||
success.boolean = True
|
||||
last_run.allow_tags = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user