Commit 2d2fd410 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

tsio: move helper in the right place

parent fa5ddafb26ec
......@@ -210,13 +210,6 @@ class TimeSerie(SeriesServices):
for idate, serie in series
}
def _previous_cset(self, cn, seriename, csid):
tablename = self._serie_to_tablename(cn, seriename)
sql = ('select cset from "{}.timeserie"."{}" '
'where cset < %(csid)s '
'order by cset desc limit 1').format(self.namespace, tablename)
return cn.execute(sql, csid=csid).scalar()
def get_delta(self, cn, seriename, delta,
from_value_date=None,
to_value_date=None):
......@@ -513,6 +506,13 @@ class TimeSerie(SeriesServices):
for row in cn.execute(sql).fetchall()
]
def _previous_cset(self, cn, seriename, csid):
tablename = self._serie_to_tablename(cn, seriename)
sql = ('select cset from "{}.timeserie"."{}" '
'where cset < %(csid)s '
'order by cset desc limit 1').format(self.namespace, tablename)
return cn.execute(sql, csid=csid).scalar()
# insertion handling
def _validate(self, cn, ts, seriename):
......
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