Changeset 842
- Timestamp:
- 10/24/07 21:48:01 (1 year ago)
- Files:
-
- satchmoproject.com/satchmo_website/apps/blog/feeds.py (modified) (4 diffs, 1 prop)
- satchmoproject.com/satchmo_website/apps/blog/models.py (modified) (4 diffs, 1 prop)
- satchmoproject.com/satchmo_website/apps/blog/readme.txt (modified) (1 diff)
- satchmoproject.com/satchmo_website/apps/blog/urls.py (modified) (3 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
satchmoproject.com/satchmo_website/apps/blog/feeds.py
- Property svn:eol-style set to native
r841 r842 12 12 def items(self): 13 13 return Entry.objects.published().order_by('-pub_date')[:5] 14 14 15 15 16 16 class LatestEntriesByTag(Feed): 17 17 18 18 def get_object(self, bits): 19 19 # In case of "/rss/beats/0613/foo/bar/baz/", or other such clutter, … … 23 23 entry_tag = Tag.objects.get(name=bits[0]) 24 24 return TaggedItem.objects.get_by_model(Entry, entry_tag), bits[0] 25 25 26 26 def title(self, obj): 27 27 return "Latest satchmo project news by tag" … … 32 32 except TypeError: 33 33 return "http://www.satchmoproject.com/blog/tag/" 34 34 35 35 def description(self, obj): 36 36 try: … … 38 38 except TypeError: 39 39 return "Unknown tag" 40 40 41 41 def items(self, obj): 42 42 if obj: satchmoproject.com/satchmo_website/apps/blog/models.py
- Property svn:eol-style set to native
r841 r842 8 8 def published(self): 9 9 return self.filter(is_published=True) 10 10 11 11 def not_published(self): 12 12 return self.filter(is_published=False) 13 13 14 14 class Entry(models.Model): 15 15 pub_date = models.DateTimeField() … … 40 40 else: 41 41 return u"/blog/preview/%s/%s/" % (self.pub_date.strftime("%Y/%b/%d").lower(), self.slug) 42 42 43 43 def save(self): 44 44 # Add the currently logged in user as the author … … 53 53 view_entry.allow_tags = True 54 54 55 56 55 class EntryModerator(CommentModerator): 57 56 akismet = True … … 60 59 moderator.register(Entry, EntryModerator) 61 60 62 satchmoproject.com/satchmo_website/apps/blog/readme.txt
r717 r842 5 5 This application is the blog used on the Satchmo site. It would not have 6 6 been possible without a lot of help from folks on the web. I have attempted 7 to make sure I credited everyone but if for some reason, I haven't 7 to make sure I credited everyone but if for some reason, I haven't 8 8 recognized your contribution, please let me know. 9 9 satchmoproject.com/satchmo_website/apps/blog/urls.py
- Property svn:eol-style set to native
r841 r842 8 8 'date_field' : 'pub_date', 9 9 } 10 11 10 12 11 preview_dict = { … … 20 19 (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$','archive_month', dict(published_dict, allow_empty=True)), 21 20 (r'^(?P<year>\d{4})/$','archive_year', dict(published_dict, allow_empty=True)), 22 (r'^tag/(?P<tag>[^/]+(?u))/$', tagged_object_list, 21 (r'^tag/(?P<tag>[^/]+(?u))/$', tagged_object_list, 23 22 dict(model=Entry, paginate_by=10, allow_empty=True, 24 23 template_object_name="entry", template_name="blog/tag_list.html")), … … 27 26 28 27 urlpatterns += patterns('blog.views', 29 (r'^preview/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[0-9A-Za-z-]+)/$', 28 (r'^preview/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[0-9A-Za-z-]+)/$', 30 29 'preview_entry', dict(preview_dict, slug_field='slug')), 31 30 (r'^preview/?$','preview_all', dict(preview_dict, allow_empty=True)), 32 31 ) 33 32 34 33 feeds = { 35 34 'latest': LatestEntries,
