diff options
author | Alban Gruin | 2018-01-28 11:14:34 +0100 |
---|---|---|
committer | Alban Gruin | 2018-01-28 11:14:34 +0100 |
commit | 77a4b75431cfab7348db73b563dd005ce64be14a (patch) | |
tree | 850473bacc0a4b7203b5d7253a04c96baec9f3a8 /models.py | |
parent | 7c73c8f900b86ebd58f48171cbd5284c29bdf840 (diff) |
Changements dans le formatage du code pour le rendre plus lisible
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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") |