summaryrefslogtreecommitdiffstats
path: root/storage/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'storage/models.py')
-rw-r--r--storage/models.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/storage/models.py b/storage/models.py
index 2333e4e..72f8154 100644
--- a/storage/models.py
+++ b/storage/models.py
@@ -97,12 +97,21 @@ class ItemImage(models.Model):
return '{}'.format(self.image.name)
+class LabelStyle(models.Model):
+ uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+ old_name = models.CharField(max_length=64, editable=False, blank=True)
+ description = models.CharField(max_length=64)
+ length = models.PositiveIntegerField()
+ width = models.PositiveIntegerField()
+
+ def __str__(self):
+ return self.description
+
+
class Label(models.Model):
id = models.CharField(max_length=64, primary_key=True)
item = models.ForeignKey(Item, related_name='labels')
- style = models.CharField(max_length=32, choices=(
- ('basic_99012_v1', 'Basic Dymo 89x36mm label'),
- ), default='basic_99012_v1')
+ style = models.ForeignKey(LabelStyle)
created = models.DateTimeField(auto_now_add=True, blank=True)
def __str__(self):