convert to unicode_literals
[htsworkflow.git] / bcmagic / models.py
1 from __future__ import unicode_literals
2
3 from django.db import models
4
5 #FIXME: Should be made more generic and probably pre-populated supported list
6 #   but for now, since we only have a ZM400, this will do.
7 PRINTER_MODELS=[ ('Zebra ZM400', 'Zebra ZM400'),
8                  ('Zebra ZM600', 'Zebra ZM600')]
9
10 LABEL_SHAPES = [ ('Square', 'Square'), ('Circle', 'Circle') ]
11
12 class KeywordMap(models.Model):
13     """
14     Mapper object maps keyword|arg1|arg2|...|argN to REST urls
15     """
16     keyword = models.CharField(max_length=64)
17     regex = models.CharField(max_length=1024)
18     url_template = models.TextField()
19
20 class Printer(models.Model):
21     """
22     Barcode Printer Information
23     """
24     name = models.CharField(max_length=256)
25     model = models.CharField(max_length=64, choices=PRINTER_MODELS)
26     ip_address = models.IPAddressField()
27     label_shape = models.CharField(max_length=32, choices=LABEL_SHAPES)
28     label_width = models.FloatField(help_text='width or diameter in inches')
29     label_height = models.FloatField(help_text='height in inches')
30     notes = models.TextField()
31
32     def __str__(self):
33         return '%s, %s, %s, %s, %sx%s' % (self.name, self.model, self.ip_address, self.label_shape, self.label_width, self.label_width)