Auto-delete child objects when deleting Client or Probe object
although if there are a lot of readings, this will still suck...
This commit is contained in:
parent
7c7dc56f8d
commit
aee6f6d341
|
@ -91,6 +91,7 @@ class Probe(Base):
|
|||
""",
|
||||
backref=orm.backref(
|
||||
'probes',
|
||||
cascade='all, delete-orphan',
|
||||
doc="""
|
||||
List of probes connected to this client.
|
||||
"""))
|
||||
|
@ -141,7 +142,10 @@ class Reading(Base):
|
|||
Probe,
|
||||
doc="""
|
||||
Reference to the tempmon probe which took this reading.
|
||||
""")
|
||||
""",
|
||||
backref=orm.backref(
|
||||
'readings',
|
||||
cascade='all, delete-orphan'))
|
||||
|
||||
taken = sa.Column(sa.DateTime(), nullable=False, default=datetime.datetime.utcnow)
|
||||
degrees_f = sa.Column(sa.Numeric(precision=7, scale=4), nullable=False)
|
||||
|
|
Loading…
Reference in a new issue