Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove DAYS_OF_WEEK_CHOICES, this is not needed anymore

Roland Geider31718a3a92c3
diff --git a/manager/models.py b/manager/models.py
index 589a24a53..326903608 100644
--- a/manager/models.py
+++ b/manager/models.py
@@ -27,15 +27,6 @@ from exercises.models import Exercise
logger = logging.getLogger('workout_manager.custom')
-# Days of the week
-DAYS_OF_WEEK_CHOICES = [(1, _('Monday')),
- (2, _('Tuesday')),
- (3, _('Wednesday')),
- (4, _('Thursday')),
- (5, _('Friday')),
- (6, _('Saturday')),
- (7, _('Sunday'))]
-
class TrainingSchedule(models.Model):
"""Model for a training schedule
diff --git a/manager/views.py b/manager/views.py
index cc86cfe50..458f6c247 100644
--- a/manager/views.py
+++ b/manager/views.py
@@ -102,18 +102,18 @@ def index(request):
# Format a bit the days so it doesn't have to be done in the template
week_day_result = []
- for i, j in DAYS_OF_WEEK_CHOICES:
+ for week in DaysOfWeek.objects.all():
day_has_workout = False
for day in current_workout.day_set.select_related():
for day_of_week in day.day.select_related():
- if day_of_week.id == i:
+ if day_of_week.id == week.id:
day_has_workout = True
- week_day_result.append((_(j), day.description, True))
+ week_day_result.append((_(week.day_of_week), day.description, True))
break
if not day_has_workout:
- week_day_result.append((_(j), _('Rest day'), False))
+ week_day_result.append((_(week.day_of_week), _('Rest day'), False))
template_data['weekdays'] = week_day_result