1 from __future__ import unicode_literals
3 from django.db import models
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')]
10 LABEL_SHAPES = [ ('Square', 'Square'), ('Circle', 'Circle') ]
12 class KeywordMap(models.Model):
14 Mapper object maps keyword|arg1|arg2|...|argN to REST urls
16 keyword = models.CharField(max_length=64)
17 regex = models.CharField(max_length=1024)
18 url_template = models.TextField()
20 class Printer(models.Model):
22 Barcode Printer Information
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()
33 return '%s, %s, %s, %s, %sx%s' % (self.name, self.model, self.ip_address, self.label_shape, self.label_width, self.label_width)