Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add convenience function to return units used

Roland Geidera2077646e84a
diff --git a/wger/core/models.py b/wger/core/models.py
index bf18a296d..214cc9dc7 100644
--- a/wger/core/models.py
+++ b/wger/core/models.py
@@ -326,6 +326,14 @@ by the US Department of Agriculture. It is extremely complete, with around
'''
return u"Profile for user {0}".format(self.user)
+ @property
+ def use_metric(self):
+ '''
+ Simple helper that checks whether the user uses metric units or not
+ :return: Boolean
+ '''
+ return self.weight_unit == 'kg'
+
def calculate_bmi(self):
'''
Calculates the user's BMI