Commit 60f05665 authored by schmittu's avatar schmittu 🍺
Browse files

WIP: backup

parent f1342e13
......@@ -54,6 +54,21 @@ class SignalSignalQualityAssociation(Base):
signal_quality = relationship("SignalQualityDbo", back_populates="signals")
class Signal2dDbo(Base):
"""(formerly known as fact table)
Contains the measured value of a given parameter taken a at a specific time, site
"""
__tablename__ = "signal_2d"
signal_2d_id = Column(Integer(), primary_key=True)
x = Column(Float(), nullable=False)
y = Column(Float(), nullable=True)
value = Column(Float(), nullable=False)
signal_id = Column(ForeignKey("signal.signal_id"), nullable=True)
class SignalDbo(Base):
"""(formerly known as fact table)
Contains the measured value of a given parameter taken a at a specific time, site
......@@ -77,6 +92,8 @@ class SignalDbo(Base):
source = relationship("SourceDbo")
parameter = relationship("ParameterDbo")
signal_2d = relationship("Signal2dDbo")
comments = relationship(
"SignalCommentAssociation",
back_populates="signal",
......@@ -95,14 +112,16 @@ class SignalDbo(Base):
"coord_z",
"site_id",
"parameter_id",
"source_id",
"source_id",
"signal_2d_id",
),
)
def __str__(self):
return (
"<SourceDbo signal_id={signal_id}, parameter_id={parameter_id}, "
"value={value}, timestamp={timestamp}, site={site_id}>"
"value={value}, timestamp={timestamp}, site={site_id}, "
"signal_2d_id={signal_2d_id}>"
).format(**vars(self))
def resolved_columns(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment