summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/media/models.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/media/models.py b/app/media/models.py
index d9becf4..c93b9fc 100644
--- a/app/media/models.py
+++ b/app/media/models.py
@@ -26,6 +26,21 @@ from .utils import resize_image
from locations.models import Location, CheckIn
+def add_mp4(self, filepath, luxvideo):
+ full_filepath = "/home/lxf/sites/django/luxagraf.net/"+filepath
+ v = open(filepath, "rb")
+ django_file = File(v)
+ video = LuxVideo.objects.get(title=luxvideo)
+ video.video_mp4.save(filepath, django_file, save=True)
+
+
+def add_webm(self, filepath, luxvideo):
+ full_filepath = "/home/lxf/sites/django/luxagraf.net/"+filepath
+ v = open(filepath, "rb")
+ django_file = File(v)
+ video = LuxVideo.objects.get(title=luxvideo)
+ video.video_webm.save(filepath, django_file, save=True)
+
def get_upload_path(self, filename):
return "images/original/%s/%s" % (datetime.datetime.today().strftime("%Y"), filename)