Tweak import placement to fix startup
i.e. per Continuum needs
This commit is contained in:
parent
9f21244ede
commit
2acc49be40
|
@ -32,8 +32,6 @@ import logging
|
||||||
from rattail import commands
|
from rattail import commands
|
||||||
from rattail.time import localtime, make_utc
|
from rattail.time import localtime, make_utc
|
||||||
|
|
||||||
from rattail_tempmon.db import Session as TempmonSession, model as tempmon
|
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -62,6 +60,8 @@ class PurgeTempmon(commands.Subcommand):
|
||||||
"occur, but rollback (abort) the transaction at the end.")
|
"occur, but rollback (abort) the transaction at the end.")
|
||||||
|
|
||||||
def run(self, args):
|
def run(self, args):
|
||||||
|
from rattail_tempmon.db import Session as TempmonSession, model as tempmon
|
||||||
|
|
||||||
cutoff = localtime(self.config).date() - datetime.timedelta(days=args.keep)
|
cutoff = localtime(self.config).date() - datetime.timedelta(days=args.keep)
|
||||||
cutoff = localtime(self.config, datetime.datetime.combine(cutoff, datetime.time(0)))
|
cutoff = localtime(self.config, datetime.datetime.combine(cutoff, datetime.time(0)))
|
||||||
session = TempmonSession()
|
session = TempmonSession()
|
||||||
|
|
Loading…
Reference in a new issue