def locations(): return Select( source = Tables.locations(), fields = Fields.locations(), filter = Filter(None), order = Order.locations() ).execute(cursor())
def conference_events(id = None, abbreviation = None): conf = conference(id, abbreviation) if conf['parent']: conf['parent'] = conference(id = int(conf['parent'])) if conf['tags'] and len(conf['tags']) > 0: conf['tags'] = [ name for (id, name) in get_tags(ids = conf['tags'].split(',')) ] else: conf['tags'] = [] events = Select( filter = Filter('conference = %d' % conf['conference']), order = Order.start_date(reverse = True), ).execute(cursor()) return (conf, events)
def recent(tags = []): query = Select( filter = Filter.recent() & Filter.tags(tags), order = Order.start_date(reverse = True)) return query.execute(cursor())
def upcoming(tags = []): query = Select( filter = Filter.upcoming() & Filter.tags(tags), order = Order.start_date()) return query.execute(cursor())
def deadlines(tags = []): query = Select( filter = Filter.upcomingDeadlines() & Filter.tags(tags), order = Order.deadline()) return query.execute(cursor())