summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/TODO12
-rw-r--r--app/birds/build.py21
-rw-r--r--app/birds/models.py4
-rw-r--r--app/builder/views.py4
-rw-r--r--design/templates/admin/buttons.html1
5 files changed, 30 insertions, 12 deletions
diff --git a/app/TODO b/app/TODO
index 553c387..1d801b3 100644
--- a/app/TODO
+++ b/app/TODO
@@ -34,19 +34,7 @@ port existing galleries to new structure
---
-# birds app:
-
-Finish detail template
-write build script
-
----
-
# notes
revamp notes to be like my own personal instagram
----
-
-#content marketing page:
-
-Consistently posted high-quality content, and research into topics are still paramount to your web presence. The better your content, the better your SEO.
diff --git a/app/birds/build.py b/app/birds/build.py
index e69de29..870133f 100644
--- a/app/birds/build.py
+++ b/app/birds/build.py
@@ -0,0 +1,21 @@
+import os
+from django.core.urlresolvers import reverse
+from builder.base import BuildNew
+
+
+class BuildBirds(BuildNew):
+
+ def build(self):
+ self.build_detail_view()
+ self.build_list_view(
+ base_path=reverse("birds:list_redirect"),
+ paginate_by=24
+ )
+ print("building birds")
+
+ def get_model_queryset(self):
+ return self.model.objects.all()
+
+def builder():
+ j = BuildBirds("birds", "birdsighting")
+ j.build()
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
diff --git a/app/builder/views.py b/app/builder/views.py
index 4fc6d6a..dfce406 100644
--- a/app/builder/views.py
+++ b/app/builder/views.py
@@ -5,6 +5,7 @@ from src.build import builder as src_builder
from jrnl.build import archive_builder, detail_builder, home_builder, rss_builder, amp_builder
from resume.build import builder as resume_builder
from books.build import builder as book_builder
+from birds.build import builder as bird_builder
from photos.build import builder as photo_builder
from figments.build import builder as figments_builder
@@ -40,6 +41,9 @@ def do_build(request):
elif section == 'buildbooks':
context = {'message': 'Writing Book Pages to Disk'}
book_builder()
+ elif section == 'buildbirds':
+ context = {'message': 'Writing Bird Pages to Disk'}
+ bird_builder()
elif section == 'src':
context = {'message': 'Writing src section to Disk'}
src_builder()
diff --git a/design/templates/admin/buttons.html b/design/templates/admin/buttons.html
index b512625..777d7e5 100644
--- a/design/templates/admin/buttons.html
+++ b/design/templates/admin/buttons.html
@@ -48,6 +48,7 @@
<li class="item"><a href="/admin/build/build?id=projects">Build Project Pages</a></li>
<li class="item"><a href="/admin/build/build?id=map">Build Map</a></li>
<li class="item"><a href="/admin/build/build?id=buildbooks">Build Books</a></li>
+ <li class="item"><a href="/admin/build/build?id=buildbirds">Build Birds</a></li>
<li class="item"><a href="/admin/build/build?id=pages">Build All Pages</a></li>
<li class="item"><a href="/admin/build/build?id=sitemap">Build Sitemap</a></li>
<li class="item"><a href="/admin/build/build?id=src">Build src</a></li>