def clear(self):
"""Clear output of one climate variable
"""
# mark this task as incomplete
self.mark_incomplete()
# Delete the indicator metadata, this also deletes values by cascading.
for suffix in list(CLIMATE_SEASON_SUFFIXES.values()):
try:
# noinspection PyUnresolvedReferences
indicator = self.session.query(models.ClimateIndicator) \
.filter(models.ClimateIndicator.description == self.description + suffix) \
.one()
self.session.delete(indicator)
except NoResultFound:
# Data didn't exist yet, no problem
pass
self.close_session()
评论列表
文章目录