Skip to content

Commit

Permalink
Added start and end dates as DateTime types within SQLAlchemy
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerkclark committed Jan 25, 2016
1 parent 29e4bfc commit 3c618af
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aospy_synthetic/aospy_db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine, ForeignKey
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy.sql import ClauseElement
Expand Down Expand Up @@ -128,7 +128,8 @@ class Calc(Base):
intvl_out = Column(String)
dtype_out_time = Column(String)
units = Column(String)
date_range = Column(String)
start_date = Column(DateTime)
end_date = Column(DateTime)
pressure_type = Column(String)

def __repr__(self):
Expand Down
2 changes: 2 additions & 0 deletions aospy_synthetic/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ def __init__(self, calc_interface):
intvl_in=self.intvl_in,
intvl_out=self.intvl_out,
dtype_out_time=d,
start_date=self.start_date,
end_date=self.end_date,
pressure_type=str(self.level))
session.commit()
session.close()
Expand Down
Binary file modified test.db
Binary file not shown.

0 comments on commit 3c618af

Please sign in to comment.