polecenie do aktualizacji liczników
authorJan Szejko <j-sz@o2.pl>
Tue, 26 Jan 2016 13:48:49 +0000 (14:48 +0100)
committerJan Szejko <j-sz@o2.pl>
Tue, 26 Jan 2016 13:48:49 +0000 (14:48 +0100)
src/catalogue/management/commands/update_counters.py [new file with mode: 0644]

diff --git a/src/catalogue/management/commands/update_counters.py b/src/catalogue/management/commands/update_counters.py
new file mode 100644 (file)
index 0000000..089dd0f
--- /dev/null
@@ -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()