def _jsonify_one(self, attribute): counts = self._get_room_counts() attr = room_attribute_schema.dump(attribute) attr['num_rooms'] = counts.get(attr['id'], 0) return jsonify(attr)
def _jsonify_one(self, attribute): counts = self._get_room_counts() attr = room_attribute_schema.dump(attribute).data attr['num_rooms'] = counts.get(attr['id'], 0) return jsonify(attr)
def _dump_attributes(self): query = RoomAttribute.query.order_by(RoomAttribute.title) return room_attribute_schema.dump(query, many=True)
def _dump_attributes(self): query = RoomAttribute.query.order_by(RoomAttribute.title) return room_attribute_schema.dump(query, many=True).data