summaryrefslogtreecommitdiff
path: root/app/birds/models.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-03-27 20:36:09 -0400
committerluxagraf <sng@luxagraf.net>2016-03-27 20:36:09 -0400
commit64f5a3f949c94248e90d1583cb1cd558cda1acf7 (patch)
tree13b0b1e0c0fe54b5d454222613faf97f89d88d30 /app/birds/models.py
parent7a75c5c452cbe7bcb45ee81aca269261eecef916 (diff)
added build script to birds app
Diffstat (limited to 'app/birds/models.py')
-rw-r--r--app/birds/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/birds/models.py b/app/birds/models.py
index af31c3f..afb6099 100644
--- a/app/birds/models.py
+++ b/app/birds/models.py
@@ -10,6 +10,7 @@ from django.conf import settings
from photos.models import LuxImage
+
def get_upload_path(self, filename):
return "images/bird-images/%s/%s" % (datetime.datetime.today().strftime("%Y"), filename)
@@ -126,6 +127,9 @@ class BirdSighting(models.Model):
if size.width > 360 and size.width < 700:
return img.get_image_by_size(size)
+ def get_absolute_url(self):
+ return reverse("birds:detail", kwargs={"slug": self.bird.slug})
+
def __str__(self):
return self.bird.common_name