diff options
author | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2010-06-09 11:14:18 +0000 |
---|---|---|
committer | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2010-06-09 11:14:18 +0000 |
commit | feebdc2e14426921a585c31c5279886bca3e2eca (patch) | |
tree | 82fbb3700d5d43d1d302d95c639d0d540b7bcabb /test.py | |
parent | 602182ed488c9713d793206f6da2f3758051c32d (diff) | |
download | ebus-alt-feebdc2e14426921a585c31c5279886bca3e2eca.tar.gz ebus-alt-feebdc2e14426921a585c31c5279886bca3e2eca.zip |
foo
git-svn-id: http://10.2.2.13/svn/common/ebus@1676 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -0,0 +1,32 @@ + +import model +from sqlalchemy import create_engine + +#engine = create_engine('sqlite:///:memory:', echo=True) +engine = create_engine("postgresql://yvesf:iii@10.2.2.13:5432/yvesf", echo=True) + +model.Base.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) + +t1_value1 = model.Value(t1_sensor, 0.5) +session.add(t1_value1) + +session.commit() + + + + +session.close() + + + + |