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