summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2012-10-14 22:27:32 -0400
committerluxagraf <sng@luxagraf.net>2012-10-14 22:27:32 -0400
commit3e2646125792d2152aef086bfad2f0d1062f1d66 (patch)
treecc9354bce62d97899a4539b619d2df71e29bb1dd /app
parentfa869d1a60ff6f8c41cd7f2bf0e0964bff9ba9f1 (diff)
added project app to handle any animated gifs I might create :-)
Diffstat (limited to 'app')
-rw-r--r--app/projects/models/gifs.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/projects/models/gifs.py b/app/projects/models/gifs.py
new file mode 100644
index 0000000..b6eb066
--- /dev/null
+++ b/app/projects/models/gifs.py
@@ -0,0 +1,24 @@
+import datetime
+from django.db import models
+
+
+def get_upload_path(self, filename):
+ return "images/projects/gifs/%s/%s" %(datetime.datetime.today().strftime("%Y"), filename)
+
+
+class AnimatedGif(models.Model):
+ title = models.CharField(max_length=254)
+ gif = models.ImageField(upload_to=get_upload_path)
+ slug = models.SlugField()
+ date_created = models.DateField('Date Created')
+ music_ogg = models.FileField(upload_to=get_upload_path, blank=True, null=True)
+ music_mp3 = models.FileField(upload_to=get_upload_path, blank=True, null=True)
+
+ class Meta:
+ verbose_name_plural = "Animated Gifs"
+ app_label = 'projects'
+ ordering = ('-date_created',)
+ # Returns the string representation of the model.
+ def __unicode__(self):
+ return self.slug
+