From e528c8748cfcb281befcb67263a3546cc30d449c Mon Sep 17 00:00:00 2001 From: Ahmed KOLSI <47521517+kolsiA@users.noreply.github.com> Date: Thu, 28 Mar 2019 11:20:40 +0100 Subject: [PATCH] work for django > 1.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the 1.9 release, In particular, it isn’t possible to import models inside the root package of an application. --- periodically/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/periodically/utils.py b/periodically/utils.py index cdb0be2..745194f 100644 --- a/periodically/utils.py +++ b/periodically/utils.py @@ -1,6 +1,6 @@ from django.utils import importlib, timezone from . import settings -from .models import ExecutionRecord + class InvalidBackendAliasError(Exception): @@ -14,6 +14,7 @@ def __init__(self, backend): def get_scheduled_time(task, schedule, now=None): + from .models import ExecutionRecord previous_record = ExecutionRecord.objects.get_most_recent(task, schedule) if not now: now = timezone.now()