Ejemplo n.º 1
0
def conferences():
	return Select(
			fields = Fields.conference(),
			source = Tables.conference(),
			filter = Filter(None),
			order = Order("abbreviation"),
		).execute(cursor())
Ejemplo n.º 2
0
def locations():
	return Select(
			source = Tables.locations(),
			fields = Fields.locations(),
			filter = Filter(None),
			order = Order.locations()
		).execute(cursor())
Ejemplo n.º 3
0
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())
Ejemplo n.º 4
0
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__