From d8b00fd3068e2eae17282900a638eb269d4cf2c9 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sun, 25 Oct 2015 21:36:54 +0200 Subject: Added QueueStatus ordering --- servo/models/queue.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'servo/models') diff --git a/servo/models/queue.py b/servo/models/queue.py index 05f5f2c..eb8414e 100644 --- a/servo/models/queue.py +++ b/servo/models/queue.py @@ -246,14 +246,16 @@ class QueueStatus(models.Model): queue = models.ForeignKey(Queue) status = models.ForeignKey(Status) - limit_green = models.IntegerField(default=1, verbose_name=_(u'green limit')) - limit_yellow = models.IntegerField(default=15, verbose_name=_(u'yellow limit')) + limit_green = models.IntegerField(default=1, verbose_name=_(u'Green limit')) + limit_yellow = models.IntegerField(default=15, verbose_name=_(u'Yellow limit')) limit_factor = models.IntegerField( choices=Status.FACTOR_CHOICES, - verbose_name=_(u'time unit'), + verbose_name=_(u'Time unit'), default=Status.FACTOR_CHOICES[0][0] ) + idx = models.IntegerField(default=1, verbose_name=_(u'Ordering')) + def get_green_limit(self): """ Gets the green time limit for this QS @@ -268,5 +270,6 @@ class QueueStatus(models.Model): class Meta: app_label = 'servo' + ordering = ('idx',) # A status should only be defined once per queue unique_together = ('queue', 'status',) -- cgit v1.2.3