Exemplo n.º 1
0
 def process_formdata(self, valuelist):
     super(IndicoLocationField, self).process_formdata(valuelist)
     self.data['room'] = Room.get(int(
         self.data['room_id'])) if self.data.get('room_id') else None
     self.data['venue'] = Location.get(int(
         self.data['venue_id'])) if self.data.get('venue_id') else None
     self.data['source'] = self.object_data.get(
         'source') if self.object_data else None
Exemplo n.º 2
0
 def _inject_long_term_attribute(self, sender, data, **kwargs):
     long_term_room_ids = {
         room.id
         for room, value in Room.find_with_attribute('long-term')
         if value.lower() in ('true', '1', 'yes')
     }
     for room in data:
         room['is_long_term'] = room['id'] in long_term_room_ids
Exemplo n.º 3
0
 def _getPageContent(self, params):
     params['endpoints'] = self.endpoints
     calendar = RoomBookingCalendarWidget(params['occurrences'], params['start_dt'], params['end_dt'],
                                          candidates=params['candidates'], specific_room=params['room'],
                                          repeat_frequency=params['repeat_frequency'],
                                          repeat_interval=params['repeat_interval'])
     params['calendar'] = calendar.render(show_navbar=False, details_in_new_tab=True)
     params['serializable_room'] = Room.get(params['room'].id).to_serializable('__public_exhaustive__')
     params['booking_limit'] = rb_settings.get('booking_limit')
     return WTemplated('RoomBookingBookingForm').getHTML(params)
Exemplo n.º 4
0
def _get_serializable_rooms(room_ids):
    # all the rooms are already in sqlalchemy's identity cache so they won't be queried again
    return [
        Room.get(r).to_serializable('__public_exhaustive__') for r in room_ids
    ]
Exemplo n.º 5
0
def _get_serializable_rooms(room_ids):
    # all the rooms are already in sqlalchemy's identity cache so they won't be queried again
    return [Room.get(r).to_serializable('__public_exhaustive__') for r in room_ids]
Exemplo n.º 6
0
 def _process_args(self):
     self.room = Room.get_one(request.view_args['room_id'])
Exemplo n.º 7
0
 def process_formdata(self, valuelist):
     super(IndicoLocationField, self).process_formdata(valuelist)
     self.data['room'] = Room.get(int(self.data['room_id'])) if self.data.get('room_id') else None
     self.data['venue'] = Location.get(int(self.data['venue_id'])) if self.data.get('venue_id') else None
     self.data['source'] = self.object_data.get('source') if self.object_data else None
Exemplo n.º 8
0
 def process_formdata(self, valuelist):
     super(IndicoLocationField, self).process_formdata(valuelist)
     self.data["room"] = Room.get(int(self.data["room_id"])) if self.data.get("room_id") else None
     self.data["venue"] = Location.get(int(self.data["venue_id"])) if self.data.get("venue_id") else None
     self.data["source"] = self.object_data.get("source") if self.object_data else None