Source

cciw-website / cciw / cciwmain / models.py

Diff from to

File cciw/cciwmain/models.py

 class CampManager(models.Manager):
     use_for_related_fields = True
     def get_query_set(self):
-        return super(CampManager, self).get_query_set().select_related('chaplain')
+        return super(CampManager, self).get_query_set().select_related('chaplain').prefetch_related('leaders')
 
     def get_by_natural_key(self, year, number):
         return self.get(year=year, number=number)
                 max(self.max_male_campers - males_booked, 0),
                 max(self.max_female_campers - females_booked, 0))
 
+    def is_booking_open(self):
+        from cciw.bookings.views import is_booking_open
+        return is_booking_open(self.year)
+
     class Meta:
         ordering = ['-year','number']
         unique_together = (('year', 'number'),)
 
 
-
-
 import cciw.cciwmain.hooks