Self hosted FLOSS fitness/workout, nutrition and weight tracker
Standardise the __unicode__ method in models
Roland Geider1057fc8d6412
diff --git a/wger/exercises/models.py b/wger/exercises/models.pyindex 592d492a2..034d63d4a 100644--- a/wger/exercises/models.py+++ b/wger/exercises/models.py@@ -43,7 +43,7 @@ class Language(models.Model):'''Return a more human-readable representation'''- return "%s (%s)" % (self.full_name, self.short_name)+ return u"{0} ({1})".format(self.full_name, self.short_name)class Muscle(models.Model):diff --git a/wger/manager/models.py b/wger/manager/models.pyindex c5d1c1828..301532f82 100644--- a/wger/manager/models.py+++ b/wger/manager/models.py@@ -245,7 +245,7 @@ class ScheduleStep(models.Model):'''Return a more human-readable representation'''- return "ID: {0}".format(self.id)+ return u"ID: {0}".format(self.id)class DaysOfWeek(models.Model):@@ -284,7 +284,7 @@ class Day(models.Model):'''Return a more human-readable representation'''- return "%s for TP %s" % (self.description, unicode(self.training))+ return u"{0} for TP {1}".format(self.description, unicode(self.training))def get_owner_object(self):'''@@ -321,7 +321,7 @@ class Set(models.Model):'''Return a more human-readable representation'''- return "Set-ID %s" % (self.id)+ return u"Set-ID {0}".format(self.id)def get_owner_object(self):'''@@ -349,7 +349,7 @@ class Setting(models.Model):'''Return a more human-readable representation'''- return "settings for exercise %s in set %s" % (self.exercise.id, self.set.id)+ return u"settings for exercise {0} in set {1}".format(self.exercise.id, self.set.id)def get_owner_object(self):'''@@ -385,9 +385,9 @@ class WorkoutLog(models.Model):'''Return a more human-readable representation'''- return "Log entry: %s - %s kg on %s" % (self.reps,- self.weight,- self.date)+ return u"Log entry: {0} - {1} kg on {2}".format(self.reps,+ self.weight,+ self.date)def get_owner_object(self):'''@@ -477,7 +477,7 @@ by the US Department of Agriculture. It is extremely complete, with around'''Return a more human-readable representation'''- return "Profile for user %s" % (self.user)+ return u"Profile for user {0}".format(self.user)# Every new user gets a profilediff --git a/wger/nutrition/models.py b/wger/nutrition/models.pyindex 1be1c30d7..5c5c4f332 100644--- a/wger/nutrition/models.py+++ b/wger/nutrition/models.py@@ -66,7 +66,7 @@ class NutritionPlan(models.Model):'''Return a more human-readable representation'''- return "Nutrition plan for %s, %s" % (self.user, self.creation_date)+ return u"Nutrition plan for {0}, {1}".format(self.user, self.creation_date)def get_absolute_url(self):'''@@ -294,7 +294,7 @@ class Ingredient(models.Model):'''Return a more human-readable representation'''- return "{0}".format(self.name)+ return u"{0}".format(self.name)def __eq__(self, other):'''@@ -396,7 +396,7 @@ class Meal(models.Model):'''Return a more human-readable representation'''- return "%s Meal" % (self.order,)+ return u"{0} Meal" % (self.order,)def get_owner_object(self):'''@@ -462,7 +462,7 @@ class MealItem(models.Model):'''Return a more human-readable representation'''- return "%sg ingredient %s" % (self.amount, self.ingredient_id)+ return u"{0}g ingredient {1}".format(self.amount, self.ingredient_id)def get_owner_object(self):'''diff --git a/wger/weight/models.py b/wger/weight/models.pyindex 3b56e5263..3bccb45e3 100644--- a/wger/weight/models.py+++ b/wger/weight/models.py@@ -41,7 +41,7 @@ class WeightEntry(models.Model):'''Return a more human-readable representation'''- return "%s: %s kg" % (self.creation_date, self.weight)+ return u"{0}: {1} kg".format(self.creation_date, self.weight)def get_owner_object(self):'''