a3380ed37242

Cleanup Tuesdays - Removed the photoblog, removed the silly ProjectPhoto thing too.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 24 Mar 2009 17:57:23 -0400
parents 7e2a0c0282b3
children eca890637bb5
branches/tags (none)
files photoblog/__init__.py photoblog/admin.py photoblog/models.py photoblog/specs.py photoblog/urls.py photoblog/views.py projects/admin.py projects/models.py rss/feeds.py rss/urls.py settings.py urls.py

Changes

--- a/photoblog/admin.py	Thu Mar 19 20:53:53 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-from stevelosh.photoblog.models import Entry
-from django.contrib import admin
-
-class EntryAdmin(admin.ModelAdmin):
-    fieldsets = [
-        ('Entry', { 'fields': ['title', 'original_image', 'body'] }),
-        ('Publishing', { 'fields': ['pub_date', 'published'] }),
-        ('Advanced', { 'fields': ['slug'] }),
-    ]
-    save_on_top = True
-    list_display = ('title', 'snippet', 'num_views', 'pub_date', 'published',)
-    list_filter = ('published',)
-    date_hierarchy = 'pub_date'
-    ordering = ('-pub_date',)
-    prepopulated_fields = { 'slug': ('title',) }
-
-admin.site.register(Entry, EntryAdmin)
--- a/photoblog/models.py	Thu Mar 19 20:53:53 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-from django.db import models
-from imagekit.models import ImageModel
-import datetime
-
-class Entry(ImageModel):
-    title = models.CharField(max_length=300)
-    slug = models.SlugField()
-    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)
-    published = models.BooleanField(default=True)
-    
-    @models.permalink
-    def get_absolute_url(self):
-        return ('photoblog-entry', (self.pub_date.year, self.pub_date.month, 
-                                    self.pub_date.day, self.slug),)
-    
-    def snippet(self):
-        return self.body[:50] + ('...' if len(self.body) > 50 else '')
-    
-    class Meta:
-        verbose_name = 'entry'
-        verbose_name_plural = 'entries'
-    
-    class IKOptions:
-        spec_module = 'stevelosh.photoblog.specs'
-        cache_dir = 'storage/photoblog/cache'
-        image_field = 'original_image'
-        save_count_as = 'num_views'
-    
--- a/photoblog/specs.py	Thu Mar 19 20:53:53 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-from imagekit.specs import ImageSpec
-from imagekit import processors
-
-class ResizeThumb(processors.Resize):
-    height = 50
-
-class EnchanceThumb(processors.Adjustment): 
-    contrast = 1.2
-    sharpness = 1.1
-
-class Thumbnail(ImageSpec):
-    access_as = 'thumbnail'
-    pre_cache = True
-    processors = [ResizeThumb, EnchanceThumb]
--- a/photoblog/urls.py	Thu Mar 19 20:53:53 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('stevelosh.photoblog.views',
-    url(r'^$',                              'entry', name='photoblog-newest'),
-    url(r'^entry/(\d+)/(\d+)/(\d+)/(.*)/$', 'entry', name='photoblog-entry'),
-)
--- a/photoblog/views.py	Thu Mar 19 20:53:53 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-from stevelosh.photoblog.models import Entry
-from django.shortcuts import get_object_or_404, render_to_response
-
-def entry(request, year=None, month=None, day=None, slug=None):
-    if year == None and month == None and day == None and slug == None:
-        entry = Entry.objects.all().order_by('-pub_date')[0]
-    else:
-        entry = get_object_or_404(Entry, slug=slug, pub_date__year=year, 
-                                  pub_date__month=month, pub_date__day=day,)
-    
-    try:
-        next = entry.get_next_by_pub_date()
-    except Entry.DoesNotExist, e:
-        next = None
-    
-    try:
-        previous = entry.get_previous_by_pub_date()
-    except Entry.DoesNotExist, e:
-        previous = None
-    
-    return render_to_response('photoblog/entry.html', 
-                { 'entry': entry, 'next': next, 'previous': previous })
\ No newline at end of file
--- a/projects/admin.py	Thu Mar 19 20:53:53 2009 -0400
+++ b/projects/admin.py	Tue Mar 24 17:57:23 2009 -0400
@@ -1,4 +1,4 @@
-from stevelosh.projects.models import Project, ProjectFile, ProjectPhoto, Comment
+from stevelosh.projects.models import Project, ProjectFile, Comment
 from django.contrib import admin
 
 class ProjectAdmin(admin.ModelAdmin):
@@ -9,12 +9,6 @@
     ordering = ('-posted',)
     prepopulated_fields = { 'slug': ('name',) }
 
-class ProjectPhotoAdmin(admin.ModelAdmin):
-    fields = ('title', 'description', 'project', 'position', 'photo')
-    list_display = ('project', 'title', 'description', 'height', 'width')
-    search_fields = ('title', 'description',)
-    list_filter = ('project',)
-
 class ProjectFileAdmin(admin.ModelAdmin):
     fields = ('title', 'description', 'project', 'file',)
     list_display = ('project', 'title', 'description',)
@@ -31,6 +25,5 @@
 
 
 admin.site.register(Project, ProjectAdmin)
-admin.site.register(ProjectPhoto, ProjectPhotoAdmin)
 admin.site.register(ProjectFile, ProjectFileAdmin)
 admin.site.register(Comment, CommentAdmin)
--- a/projects/models.py	Thu Mar 19 20:53:53 2009 -0400
+++ b/projects/models.py	Tue Mar 24 17:57:23 2009 -0400
@@ -32,22 +32,6 @@
         return u"%s - %s" % (self.project.name, self.title)
 
 
-class ProjectPhoto(models.Model):
-    """A single photograph for a project."""
-    
-    title = models.CharField(blank=False, max_length=140)
-    description = models.TextField(blank=True, null=True)
-    height = models.IntegerField(blank=True, null=True)
-    width = models.IntegerField(blank=True, null=True)
-    photo = models.ImageField(upload_to='storage/projects/images',
-                              height_field='height', width_field='width')
-    project = models.ForeignKey(Project)
-    position = models.IntegerField(blank=True, null=True)
-    
-    def __unicode__(self):
-        return u"%s - %s" % (self.project.name, self.title)
-
-
 class Comment(models.Model):
     name = models.CharField(blank=False, null=False, max_length=40)
     body = models.TextField(blank=False, null=False)
--- a/rss/feeds.py	Thu Mar 19 20:53:53 2009 -0400
+++ b/rss/feeds.py	Tue Mar 24 17:57:23 2009 -0400
@@ -1,7 +1,6 @@
 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.photoblog.models import Entry as PhotoBlogEntry
 import operator
 
 
@@ -80,29 +79,6 @@
                 'Steve Losh / ' + item.name)
     
 
-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):
-        return PhotoBlogEntry.objects.filter(published=True).order_by('-pub_date')[:10]
-    
-    def item_pubdate(self, item):
-        return item.pub_date
-    
-    def item_link(self, item):
-        return '%s/?FeederAction=clicked&feed=%s&seed=%s&seed_title=%s' % \
-               (feeder,
-                'Blog', 
-                self.item_author_link + item.get_absolute_url(), 
-                'Steve Losh / ' + item.title)
-    
-
 class LatestEverything(Feed):
     title = "Steve Losh / RSS / All"
     link = "http://stevelosh.com"
@@ -118,9 +94,6 @@
         items += [{'type': 'blog', 'item': entry, 'date': entry.pub_date, 'title': entry.title} 
             for entry in Entry.objects.filter(published=True).order_by('-pub_date')[:10]]
         
-        items += [{'type': 'photoblog', 'item': entry, 'date': entry.pub_date, 'title': entry.title} 
-            for entry in PhotoBlogEntry.objects.filter(published=True).order_by('-pub_date')[:10]]
-        
         items += [{'type': 'project', 'item': project, 'date': project.posted, 'title': project.name}
             for project in Project.objects.order_by('-posted')[:10]]
         
--- a/rss/urls.py	Thu Mar 19 20:53:53 2009 -0400
+++ b/rss/urls.py	Tue Mar 24 17:57:23 2009 -0400
@@ -4,7 +4,6 @@
 feeds = { 'blog': LatestEntries, 
           'comments': LatestComments,
           'projects': LatestProjects, 
-          'photoblog': LatestPhotoBlogEntries, 
           'all': LatestEverything, }
 
 urlpatterns = patterns('stevelosh.rss.views',
--- a/settings.py	Thu Mar 19 20:53:53 2009 -0400
+++ b/settings.py	Tue Mar 24 17:57:23 2009 -0400
@@ -91,9 +91,7 @@
     'django.contrib.flatpages',
     'stevelosh.blog',
     'stevelosh.projects',
-    'stevelosh.photoblog',
     'stevelosh.messengerbag',
     'mobileadmin',
     'typogrify',
-    'imagekit',
 )
--- a/urls.py	Thu Mar 19 20:53:53 2009 -0400
+++ b/urls.py	Tue Mar 24 17:57:23 2009 -0400
@@ -11,7 +11,6 @@
     (r'^m/(.*)', mobileadmin.sites.site.root),
     url(r'^blog/', include('stevelosh.blog.urls')),
     url(r'^projects/', include('stevelosh.projects.urls')),
-    url(r'^photoblog/', include('stevelosh.photoblog.urls')),
     url(r'^rss/', include('stevelosh.rss.urls')),
     url(r'^mb/', include('stevelosh.messengerbag.urls')),