def queryConferences(self, request): """Query for conferences.""" inequality_filter, filters = formatFilters(request.filters) conferences = queries.get_conferences_with_filters(inequality_filter, filters) names = queries.get_conferences_names(conferences) items = [utils.copyConferenceToForm(conf, names[conf.organizerUserId]) for conf in conferences] return ConferenceForms(items=items)
def getConferencesToAttend(self, user, request): """Get list of conferences that user has registered for.""" profile = queries.get_create_profile(user) conferences = queries.get_conferences_to_attend(profile) names = queries.get_conferences_names(conferences) items = [utils.copyConferenceToForm(conf, names[conf.organizerUserId]) for conf in conferences] return ConferenceForms(items=items)