In [1]:
from modelmeta import v1 as modelmeta
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from optparse import OptionParser
In [4]:
engine = create_engine('postgresql://hiebert:mypass@windy.pcic.uvic.ca/pcic_meta?sslmode=require')
Session = sessionmaker(bind=engine)
session = Session()
In [5]:
q = session.query(modelmeta.DataFile)
q.count()
Out[5]:
In [6]:
myfile = q[0]
In [7]:
myfile.run.files[0].timeset.start_date
Out[7]:
In [8]:
myfile.run.driving_run, myfile.run.initialized_from_run
Out[8]:
In [9]:
myfile.data_file_variables[0].variable
Out[9]: