Exemple #1
0
 def _process(self):
     locations = (Location.query
                  .join(Room, (Location.id == Room.location_id) & Room.is_active)
                  .options(contains_eager('rooms').noload('*'))
                  .order_by(Location.name, db.func.indico.natsort(Room.full_name))
                  .all())
     return jsonify(locations_schema.dump(locations).data)
Exemple #2
0
 def _process(self):
     locations = (Location.query.join(
         Room, (Location.id == Room.location_id) & Room.is_active).options(
             contains_eager('rooms').noload('*')).order_by(
                 Location.name,
                 db.func.indico.natsort(Room.full_name)).all())
     return jsonify(locations_schema.dump(locations).data)
Exemple #3
0
 def _process(self):
     rooms_strategy = contains_eager('rooms')
     rooms_strategy.noload('*')
     rooms_strategy.joinedload('location').load_only('room_name_format')
     locations = (Location.query.join(
         Room, (Location.id == Room.location_id)
         & Room.is_active).options(rooms_strategy).order_by(
             Location.name, db.func.indico.natsort(Room.full_name)).all())
     return jsonify(locations_schema.dump(locations).data)
Exemple #4
0
 def _process(self):
     rooms_strategy = contains_eager('rooms')
     rooms_strategy.noload('*')
     rooms_strategy.joinedload('location').load_only('room_name_format')
     locations = (Location.query
                  .join(Room, (Location.id == Room.location_id) & Room.is_active)
                  .options(rooms_strategy)
                  .order_by(Location.name, db.func.indico.natsort(Room.full_name))
                  .all())
     return jsonify(locations_schema.dump(locations).data)
Exemple #5
0
 def _process(self):
     locations = Location.query.all()
     return jsonify(locations_schema.dump(locations).data)