use python_2_unicode_compatible

This commit is contained in:
j 2017-03-03 08:56:35 +01:00
commit f0a4aba751
24 changed files with 130 additions and 53 deletions

View file

@ -3,6 +3,7 @@
from __future__ import division, print_function, absolute_import
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from item.models import ItemSort
@ -15,6 +16,7 @@ def parse_hash(value):
def format_hash(value):
return hex(value + 9223372036854775808)[2:-1].upper()
@python_2_unicode_compatible
class Sequence(models.Model):
class Meta:
unique_together = ("sort", "start", "end", "mode")
@ -41,7 +43,7 @@ class Sequence(models.Model):
def public_id(self):
return u"%s/%0.03f-%0.03f" % (self.sort.item.public_id, float(self.start), float(self.end))
def __unicode__(self):
def __str__(self):
return self.public_id
def json(self, keys=None, user=None):