aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-10-25 21:36:54 +0200
committerFilipp Lepalaan <filipp@mac.com>2015-10-25 21:36:54 +0200
commitd8b00fd3068e2eae17282900a638eb269d4cf2c9 (patch)
tree3da9d0545a240763de4114c7076a03f9b48e23d0 /servo/models
parent21d1d128260707f66ec61c6bedee22dd9c0473a8 (diff)
downloadServo-d8b00fd3068e2eae17282900a638eb269d4cf2c9.tar.gz
Servo-d8b00fd3068e2eae17282900a638eb269d4cf2c9.tar.bz2
Servo-d8b00fd3068e2eae17282900a638eb269d4cf2c9.zip
Added QueueStatus ordering
Diffstat (limited to 'servo/models')
-rw-r--r--servo/models/queue.py9
1 files changed, 6 insertions, 3 deletions
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',)