# HG changeset patch
# User Steve Losh
# Date 1234676061 18000
# Node ID 677d5ff5c56e8c35190b79a4dae290c7d26f92e5
# Parent 91f05965e2070807b34fc4906060746e96c9800d
Pretty much done with the photo blog.
diff -r 91f05965e207 -r 677d5ff5c56e photoblog/models.py
--- a/photoblog/models.py Sat Feb 14 23:35:49 2009 -0500
+++ b/photoblog/models.py Sun Feb 15 00:34:21 2009 -0500
@@ -5,7 +5,7 @@
class Entry(ImageModel):
title = models.CharField(max_length=300)
slug = models.SlugField()
- pub_date = models.DateField(default=datetime.datetime.today)
+ pub_date = models.DateTimeField(default=datetime.datetime.now)
body = models.TextField(blank=True)
original_image = models.ImageField(upload_to="storage/photoblog/original")
num_views = models.PositiveIntegerField(editable=False, default=0)
diff -r 91f05965e207 -r 677d5ff5c56e photoblog/specs.py
--- a/photoblog/specs.py Sat Feb 14 23:35:49 2009 -0500
+++ b/photoblog/specs.py Sun Feb 15 00:34:21 2009 -0500
@@ -4,10 +4,6 @@
class ResizeThumb(processors.Resize):
height = 50
-class ResizeDisplay(processors.Resize):
- width = 550
- height = 550
-
class EnchanceThumb(processors.Adjustment):
contrast = 1.2
sharpness = 1.1
@@ -16,7 +12,3 @@
access_as = 'thumbnail'
pre_cache = True
processors = [ResizeThumb, EnchanceThumb]
-
-class Display(ImageSpec):
- increment_count = True
- processors = [ResizeDisplay]
diff -r 91f05965e207 -r 677d5ff5c56e rss/feeds.py
--- a/rss/feeds.py Sat Feb 14 23:35:49 2009 -0500
+++ b/rss/feeds.py Sun Feb 15 00:34:21 2009 -0500
@@ -1,7 +1,7 @@
from django.contrib.syndication.feeds import Feed
from stevelosh.blog.models import Entry, Comment as BlogComment
from stevelosh.projects.models import Project, Comment as ProjectComment
-from stevelosh.thoughts.models import TextThought, LinkThought
+from stevelosh.photoblog.models import Entry as PhotoBlogEntry
import operator
@@ -80,42 +80,27 @@
'Steve Losh / ' + item.name)
-class LatestThoughts(Feed):
- title = "Steve Losh / RSS / Thoughts"
- link = "http://stevelosh.com/thoughts"
- description = "Latest thoughts from stevelosh.com"
+class LatestPhotoBlogEntries(Feed):
+ title = "Steve Losh / RSS / Photo Blog"
+ link = "http://stevelosh.com/photoblog"
+ description = "Latest photos from stevelosh.com"
item_author_name = 'Steve Losh'
item_author_email = 'steve@stevelosh.com'
item_author_link = 'http://stevelosh.com'
def items(self):
- thoughts = []
- thoughts += [{'type': 'thought-text', 'item': thought, 'date': thought.posted}
- for thought in
- TextThought.objects.order_by('-posted')[:10]]
- thoughts += [{'type': 'thought-link', 'item': thought, 'date': thought.posted}
- for thought in
- LinkThought.objects.order_by('-posted')[:10]]
- thoughts.sort(key=operator.itemgetter('date'))
- thoughts.reverse()
- return thoughts[:10]
+ return PhotoBlogEntry.objects.filter(published=True).order_by('-pub_date')[:10]
def item_pubdate(self, item):
- return item['date']
+ return item.pub_date
def item_link(self, item):
- title = 'Steve Losh / '
- if item['type'] == 'thought-text':
- title += 'Thoughts / ' + str(item['item'].id)
- elif item['type'] == 'thought-link':
- title += 'Thoughts / ' + item['item'].url
-
return '%s/?FeederAction=clicked&feed=%s&seed=%s&seed_title=%s' % \
(feeder,
- 'Thoughts',
- self.link,
- title)
+ 'Blog',
+ self.item_author_link + item.get_absolute_url(),
+ 'Steve Losh / ' + item.title)
class LatestEverything(Feed):
@@ -129,18 +114,16 @@
def items(self):
items = []
- items += [{'type': 'blog', 'item': entry, 'date': entry.pub_date}
- for entry in
- Entry.objects.filter(published=True).order_by('-pub_date')[:15]]
- items += [{'type': 'thought-text', 'item': thought, 'date': thought.posted}
- for thought in
- TextThought.objects.order_by('-posted')[:10]]
- items += [{'type': 'thought-link', 'item': thought, 'date': thought.posted}
- for thought in
- LinkThought.objects.order_by('-posted')[:10]]
- items += [{'type': 'project', 'item': project, 'date': project.posted}
- for project in
- Project.objects.order_by('-posted')[:10]]
+
+ items += [{'type': 'blog', 'item': entry, 'date': entry.pub_date, 'title': title}
+ for entry in Entry.objects.filter(published=True).order_by('-pub_date')[:10]]
+
+ items += [{'type': 'photoblog', 'item': entry, 'date': entry.pub_date, 'title': title}
+ for entry in PhotoBlogEntry.objects.filter(published=True).order_by('-pub_date')[:10]]
+
+ items += [{'type': 'project', 'item': project, 'date': project.posted, 'title': name}
+ for project in Project.objects.order_by('-posted')[:10]]
+
items.sort(key=operator.itemgetter('date'))
items.reverse()
return items[:10]
@@ -149,20 +132,8 @@
return item['date']
def item_link(self, item):
- title = 'Steve Losh / '
- new_link = ''
- if item['type'] == 'blog':
- title += item['item'].title
- new_link = self.item_author_link + item['item'].get_absolute_url()
- elif item['type'] == 'project':
- title += item['item'].name
- new_link = self.item_author_link + item['item'].get_absolute_url()
- elif item['type'] == 'thought-text':
- title += 'Thoughts / ' + str(item['item'].id)
- new_link = self.item_author_link + '/thoughts/'
- elif item['type'] == 'thought-link':
- title += 'Thoughts / ' + item['item'].url
- new_link = self.item_author_link + '/thoughts/'
+ title = 'Steve Losh / ' + item['title']
+ new_link = items['item'].get_absolute_url()
return '%s/?FeederAction=clicked&feed=%s&seed=%s&seed_title=%s' % \
(feeder,
diff -r 91f05965e207 -r 677d5ff5c56e rss/urls.py
--- a/rss/urls.py Sat Feb 14 23:35:49 2009 -0500
+++ b/rss/urls.py Sun Feb 15 00:34:21 2009 -0500
@@ -4,7 +4,7 @@
feeds = { 'blog': LatestEntries,
'comments': LatestComments,
'projects': LatestProjects,
- 'thoughts': LatestThoughts,
+ 'photoblog': LatestPhotoBlogEntries,
'all': LatestEverything, }
urlpatterns = patterns('stevelosh.rss.views',
diff -r 91f05965e207 -r 677d5ff5c56e templates/base.html
--- a/templates/base.html Sat Feb 14 23:35:49 2009 -0500
+++ b/templates/base.html Sun Feb 15 00:34:21 2009 -0500
@@ -2,76 +2,76 @@
- Steve Losh / {% block title %}{% endblock %}
-
-
-
-
-
-
-
- {% block style %}{% endblock %}
-
-
-
+ Steve Losh / {% block title %}{% endblock %}
+
+
+
+
+
+
+
+ {% block style %}{% endblock %}
+
+
+
- {% block script %}{% endblock %}
+ {% block script %}{% endblock %}
-
-
-
-
- {% block content %}{% endblock %}
-
-
-
-
+
+
+
+
+ {% block content %}{% endblock %}
+
+
+
+
\ No newline at end of file
diff -r 91f05965e207 -r 677d5ff5c56e templates/feeds/photoblog_description.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/feeds/photoblog_description.html Sun Feb 15 00:34:21 2009 -0500
@@ -0,0 +1,5 @@
+{% load markup %}
+
+
+
+{{ obj.body|markdown }}
\ No newline at end of file
diff -r 91f05965e207 -r 677d5ff5c56e templates/feeds/photoblog_title.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/feeds/photoblog_title.html Sun Feb 15 00:34:21 2009 -0500
@@ -0,0 +1,1 @@
+{{ obj.title }}
\ No newline at end of file
diff -r 91f05965e207 -r 677d5ff5c56e templates/flatpages/splash.html
--- a/templates/flatpages/splash.html Sat Feb 14 23:35:49 2009 -0500
+++ b/templates/flatpages/splash.html Sun Feb 15 00:34:21 2009 -0500
@@ -2,28 +2,28 @@
{% load typogrify %}
{% block style %}
-
+
{% endblock %}
{% block content %}
{% filter typogrify %}
-
-
-
I like writing. »
-
-
-
Things I've made. »
-
-
-
Too small to blog, too big to tweet. »
-
-
-
Who am I and what is this site? »
-
-
-
Stay up to date. »
-
-
+
+
+
I like writing. »
+
+
+
One photo per day. »
+
+
+
Some things I've made. »
+
+
+
More about me. »
+
+
+
Tasty feeds. »
+
+
{% endfilter %}
{% endblock %}
\ No newline at end of file
diff -r 91f05965e207 -r 677d5ff5c56e templates/photoblog/entry.html
--- a/templates/photoblog/entry.html Sat Feb 14 23:35:49 2009 -0500
+++ b/templates/photoblog/entry.html Sun Feb 15 00:34:21 2009 -0500
@@ -21,7 +21,7 @@
-
+
{{ entry.body|markdown|typogrify }}