def conferences(): return Select( fields = Fields.conference(), source = Tables.conference(), filter = Filter(None), order = Order("abbreviation"), ).execute(cursor())
def locations(): return Select( source = Tables.locations(), fields = Fields.locations(), filter = Filter(None), order = Order.locations() ).execute(cursor())
def most_recent(): return Select( fields = Fields.events(), source = Tables.events(), filter = Filter(""" startDate = ( select max(startDate) from ConferenceInstances AS ci where ci.conference = ConferenceInstances.conference) """), order = Order("startDate"), ).execute(cursor())
def conference(id = None, abbreviation = None): assert (id is not None) ^ (abbreviation is not None) filter = None if id is not None: filter = Filter("conference = %d" % id) else: filter = Filter("abbreviation = '%s'" % abbreviation) c = cursor() conferences = Select( fields = Fields.conference(), source = Tables.conference(), filter = filter, order = Order(None), ).execute(c) if len(conferences) == 0: return None else: return conferences[0].__dict__