Beispiel #1
0
 def _process(self, args):
     if 'bookable_hours' in args:
         self._check_invalid_times(args)
     update_room_availability(self.room, args)
     return jsonify(nonbookable_periods=nonbookable_periods_schema.dump(
         self.room.nonbookable_periods, many=True),
                    bookable_hours=bookable_hours_schema.dump(
                        self.room.bookable_hours, many=True))
Beispiel #2
0
def serialize_nonbookable_periods(data):
    return {
        dt.isoformat(): nonbookable_periods_schema.dump(data)
        for dt, data in data.iteritems()
    }
Beispiel #3
0
 def _process(self):
     return jsonify(nonbookable_periods=nonbookable_periods_schema.dump(
         self.room.nonbookable_periods, many=True),
                    bookable_hours=bookable_hours_schema.dump(
                        self.room.bookable_hours, many=True))
Beispiel #4
0
def serialize_nonbookable_periods(data):
    return {dt.isoformat(): nonbookable_periods_schema.dump(data).data for dt, data in data.iteritems()}