summaryrefslogtreecommitdiff
path: root/webcam/management/commands
diff options
context:
space:
mode:
authorcoderick142017-05-17 15:40:18 +0530
committercoderick142017-05-17 15:41:00 +0530
commita1e0a5502f04da68b6a9ca8508dda3f9d7e1d055 (patch)
tree20181e6b1936f50ad48d8e35720d64a37566f558 /webcam/management/commands
parent6f4a84c1e58ff4d54aab94cbee26e995328b05b8 (diff)
downloadSBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.tar.gz
SBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.tar.bz2
SBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.zip
Upgrade to Django 1.11
- Database integration yet to be tested
Diffstat (limited to 'webcam/management/commands')
-rw-r--r--webcam/management/commands/__init__.py0
-rw-r--r--webcam/management/commands/reload_images.py12
2 files changed, 12 insertions, 0 deletions
diff --git a/webcam/management/commands/__init__.py b/webcam/management/commands/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/webcam/management/commands/__init__.py
diff --git a/webcam/management/commands/reload_images.py b/webcam/management/commands/reload_images.py
new file mode 100644
index 0000000..5b735cb
--- /dev/null
+++ b/webcam/management/commands/reload_images.py
@@ -0,0 +1,12 @@
+from django.core.management.base import BaseCommand
+from sbhs_server.tables.models import Board
+from sbhs_server.webcam.views import load_image
+
+class Command(BaseCommand):
+ args = ''
+ help = 'Reloads images for all SBHS machines'
+
+ def handle(self, *args, **options):
+ boards = Board.objects.all()
+ for b in boards:
+ load_image(b.mid)