Skip to content

Commit

Permalink
improved string rear for models
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Renner committed Dec 4, 2017
1 parent 82abcd0 commit e8d0234
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions userproperty/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ class Meta:
unique_together = (("user", "name"),)

def __str__(self):
s = "UserProperty for " + self.user.username
s += " with name '" + self.name + "' is set to '" + str(self.value) + "'."
return s
return u"UserProperty for {} with name '{}' is set to '{}'".format(self.user, self.name, self.value)


@python_2_unicode_compatible
Expand All @@ -37,4 +35,4 @@ class Meta:
verbose_name_plural = 'Global Properties'

def __str__(self):
return "GlobalProperty with name '" + self.name + "' is set to '" + str(self.value) + "'."
return "GlobalProperty with name '{}' is set to '{}'".format(self.name, self.value)

0 comments on commit e8d0234

Please sign in to comment.