Exemplo n.º 1
0
def createDB():
	#create the new database and session
	try:
		print "Attempting Database Creation"
		session=budg_main.createAll()
		session.close()
	except:
		print "Database creation Failed"
	else:
		print "Database create Complete"
Exemplo n.º 2
0
def testEntries_Expense():
	#a function to quickly fill out a DB in case of deletion, used for testing
	#creates multiple test entries
	session=budg_main.createAll()	#create a session to edit the expense table with
	#create basic entries
	session.add(Expense("car",True,date(2013,12,14),"",True,311,"",False))
	#commit the entries
	session.commit()
	#search for all results
	result=session.query(Expense)
	for thing in result:
		print thing
	session.close()