From 02f48f7a905973428fc7766cf92bb04614e1fdca Mon Sep 17 00:00:00 2001 From: yvesf Date: Sun, 24 Jul 2011 13:12:14 +0200 Subject: cleanup, tag version 0.3 --- ormtest.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100755 ormtest.py (limited to 'ormtest.py') diff --git a/ormtest.py b/ormtest.py deleted file mode 100755 index 91b8277..0000000 --- a/ormtest.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/python -from ebus.web import model -from sqlalchemy import create_engine - -#engine = create_engine('sqlite:///:memory:', echo=True) -engine = create_engine("postgresql:///ebus_test", echo=False) - -model.ModelBase.metadata.create_all(engine) - -from sqlalchemy.orm import sessionmaker -Session = sessionmaker() -Session.configure(bind=engine) - -session = Session() - -t1_sensor = model.Sensor("foosensor", "blatest") -session.add(t1_sensor) - -#annahme 100 mal 3 values /min -for i in xrange(360*24*60*100): - session.add( model.ValueInt(t1_sensor, 1) ) - - session.add( model.ValueFloat(t1_sensor, 1.2) ) - - session.add( model.ValueString(t1_sensor, "foobar") ) - - if i%1000 == 0: - print i - session.commit() - -session.commit() -session.close() - -- cgit v1.2.1