def getrooms(request): """Gets info for the given rooms, from `rids` params.""" rids = json.loads(request.GET['rids']) result = {} for shortname in rids: room, _ = Room.get_or_create_by_shortname(shortname) result[room.shortname] = room.to_dict() return json_response(result)
def getroom(request): """Gets info for the given room, from `title` param.""" shortname = request.GET['shortname'] room, _ = Room.get_or_create_by_shortname(shortname) return json_response(room.to_dict())