Skip to content

Commit

Permalink
fixing db.Session in dapdb schema
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed Apr 13, 2020
1 parent 13b5c08 commit 10e683b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/sdssdb/sqlalchemy/mangadb/dapdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def ftype(self):

@property
def partner(self):
session = db.Session.object_session(self)
session = database.Session.object_session(self)
return session.query(File).join(Structure, datadb.Cube, FileType).filter(
Structure.pk == self.structure.pk, datadb.Cube.pk == self.cube.pk,
FileType.pk != self.filetype.pk).one()
Expand Down Expand Up @@ -114,7 +114,7 @@ class Hdu(Base):
def header(self):
'''Returns an astropy header'''

session = db.Session.object_session(self)
session = database.Session.object_session(self)
data = session.query(HeaderKeyword.name, HeaderValue.value,
HeaderValue.comment).join(HeaderValue, HduToHeaderValue).filter(
HduToHeaderValue.header_value_pk == HeaderValue.pk,
Expand Down Expand Up @@ -280,7 +280,7 @@ def get3DCube(self, extension='flux'):
"""

session = db.Session.object_session(self)
session = database.Session.object_session(self)
spaxels = session.query(getattr(ModelSpaxel, extension)).filter(
ModelSpaxel.modelcube_pk == self.pk).order_by(ModelSpaxel.x, ModelSpaxel.y).all()

Expand Down

0 comments on commit 10e683b

Please sign in to comment.