aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2018-01-28 11:14:34 +0100
committerAlban Gruin2018-01-28 11:14:34 +0100
commit77a4b75431cfab7348db73b563dd005ce64be14a (patch)
tree850473bacc0a4b7203b5d7253a04c96baec9f3a8 /models.py
parent7c73c8f900b86ebd58f48171cbd5284c29bdf840 (diff)
Changements dans le formatage du code pour le rendre plus lisible
Diffstat (limited to 'models.py')
-rw-r--r--models.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/models.py b/models.py
index ba4ebaf..b762215 100644
--- a/models.py
+++ b/models.py
@@ -195,11 +195,12 @@ class CourseManager(Manager):
def get_courses(self, obj, **criteria):
qs = self.get_queryset()
if isinstance(obj, Group):
- qs = qs.filter(groups__in=Group.objects.get_parents(obj),
- **criteria).prefetch_related("rooms")
+ qs = qs.filter(
+ groups__in=Group.objects.get_parents(obj), **criteria) \
+ .prefetch_related("rooms")
elif isinstance(obj, Room):
- qs = qs.filter(rooms=obj, **criteria).prefetch_related("rooms",
- "groups")
+ qs = qs.filter(rooms=obj, **criteria) \
+ .prefetch_related("rooms", "groups")
else:
raise(TypeError, "obj must be a Group or a Room")