From fba2d9e4c09d7802ca794a0eebeb9653f4dad7bb Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 7 Oct 2022 11:43:45 +0200 Subject: [PATCH] updating filter str --- rowers/models.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rowers/models.py b/rowers/models.py index d4af5780..221e11f9 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -1378,12 +1378,20 @@ class Condition(models.Model): max_length=20, choices=conditionchoices, null=True) def __str__(self): - str = 'Condition: {metric} {condition} {value1} {value2}'.format( + str = 'Condition: {metric} {condition} {value1}'.format( metric=self.metric, condition=self.condition, value1 = self.value1, - value2 = self.value2, ) + if self.condition == 'between': + str = 'Condition: {metric} between {value1} and {value2}'.format( + metric=self.metric, + condition=self.condition, + value1 = self.value1, + value2 = self.value2, + ) + + return str