Fixed issues with __unicode__() becoming __str__() in Python 3.

Fixed recursion issue with VatRate
This commit is contained in:
tomtom5152
2014-11-05 16:50:10 +00:00
parent a4e1856dd4
commit d79b9fec9c
2 changed files with 11 additions and 10 deletions

View File

@@ -38,7 +38,7 @@ class Person(models.Model, RevisionMixin):
notes = models.TextField(blank=True, null=True)
def __unicode__(self):
def __str__(self):
string = self.name
if len(self.notes) > 0:
string += "*"
@@ -55,7 +55,7 @@ class Organisation(models.Model, RevisionMixin):
notes = models.TextField(blank=True, null=True)
union_account = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
string = self.name
if len(self.notes) > 0:
string += "*"
@@ -68,8 +68,9 @@ class VatRate(models.Model, RevisionMixin):
rate = models.DecimalField(max_digits=6, decimal_places=6)
comment = models.CharField(max_length=255)
@property
def as_percent(self):
return self.rate * 100
return (self.rate * 100)
def __unicode__(self):
def __str__(self):
return self.comment + " " + str(self.start_at) + " @ " + str(self.as_percent) + "%"