X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/01fd09f3c7d265ad5debb7e4fc78ab17ec7341b6..8a9843b112f8a3f72603afc9fb5d15ddcbd77559:/src/stats/models.py diff --git a/src/stats/models.py b/src/stats/models.py index ea1a79042..0bd391a55 100644 --- a/src/stats/models.py +++ b/src/stats/models.py @@ -1,4 +1,6 @@ import re +from urllib.request import urlopen +from django.apps import apps from django.conf import settings from django.db import models @@ -12,6 +14,7 @@ class Visits(models.Model): @classmethod def build_month(cls, year, month): + Book = apps.get_model('catalogue', 'Book') ### TODO: Delete existing? date = f'{year}-{month:02d}'