示例#1
0
文件: db.py 项目: sysconfdb/sysconfdb
def conferences():
	return Select(
			fields = Fields.conference(),
			source = Tables.conference(),
			filter = Filter(None),
			order = Order("abbreviation"),
		).execute(cursor())
示例#2
0
文件: db.py 项目: sysconfdb/sysconfdb
def locations():
	return Select(
			source = Tables.locations(),
			fields = Fields.locations(),
			filter = Filter(None),
			order = Order.locations()
		).execute(cursor())
示例#3
0
文件: db.py 项目: sysconfdb/sysconfdb
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())
示例#4
0
文件: db.py 项目: sysconfdb/sysconfdb
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__