From: Jan Szejko Date: Tue, 26 Jan 2016 13:48:49 +0000 (+0100) Subject: polecenie do aktualizacji liczników X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/487e4a8c7cbd61eb15ace5112dc5cb68d0cc3522?hp=90237b249aeb7547999e8d192cf23583f14f7a41 polecenie do aktualizacji liczników --- diff --git a/src/catalogue/management/commands/update_counters.py b/src/catalogue/management/commands/update_counters.py new file mode 100644 index 000000000..089dd0ff8 --- /dev/null +++ b/src/catalogue/management/commands/update_counters.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from __future__ import print_function, unicode_literals + +from django.conf import settings +from django.core.management.base import BaseCommand + +from catalogue.helpers import update_counters +from wolnelektury.utils import makedirs + + +class Command(BaseCommand): + help = 'Update counters.' + + def handle(self, **options): + makedirs(settings.VAR_DIR) + update_counters()