aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models
diff options
context:
space:
mode:
Diffstat (limited to 'servo/models')
-rw-r--r--servo/models/device.py4
-rw-r--r--servo/models/queue.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/servo/models/device.py b/servo/models/device.py
index a506874..148684d 100644
--- a/servo/models/device.py
+++ b/servo/models/device.py
@@ -206,7 +206,7 @@ class Device(models.Model):
@property
def tag_choices(self):
- return TaggedItem.objects.filter(content_type__model="device").distinct("tag")
+ return TaggedItem.objects.filter(ref="device").distinct("tag")
def add_tags(self, tags):
tags = [x for x in tags if x != ''] # Filter out empty tags
@@ -528,7 +528,7 @@ class Device(models.Model):
return results
- def __unicode__(self):
+ def __str__(self):
return '%s (%s)' % (self.description, self.sn)
class Meta:
diff --git a/servo/models/queue.py b/servo/models/queue.py
index 3e74783..8eefab6 100644
--- a/servo/models/queue.py
+++ b/servo/models/queue.py
@@ -167,7 +167,7 @@ class Queue(models.Model):
count = self.order_set.filter(state__lt=max_state).count()
return count if count > 0 else ''
- def __unicode__(self):
+ def __str__(self):
return self.title
class Meta:
@@ -222,7 +222,7 @@ class Status(models.Model):
def get_admin_url(self):
return reverse('admin-edit_status', args=[self.pk])
- def __unicode__(self):
+ def __str__(self):
return self.title
class Meta:
@@ -261,7 +261,7 @@ class QueueStatus(models.Model):
sec = self.limit_yellow * self.limit_factor
return timezone.now() + timedelta(seconds=sec)
- def __unicode__(self):
+ def __str__(self):
return self.status.title
class Meta: