Beispiel #1
0
 def _process(self):
     key = str(sorted(dict(request.args, lang=session.lang, user=session.user.getId()).items()))
     html = self._cache.get(key)
     if not html:
         default_location = Location.default_location
         aspects = [a.to_serializable() for a in default_location.aspects]
         buildings = default_location.get_buildings()
         html = WPRoomBookingMapOfRoomsWidget(self,
                                              aspects=aspects,
                                              buildings=buildings,
                                              room_id=self._room_id,
                                              default_repeat='{}|0'.format(RepeatFrequency.NEVER),
                                              default_start_dt=datetime.combine(date.today(),
                                                                                Location.working_time_start),
                                              default_end_dt=datetime.combine(date.today(),
                                                                              Location.working_time_end),
                                              repeat_mapping=RepeatMapping.getMapping()).display()
         self._cache.set(key, html, 3600)
     return html