Commits

Guilherme Gondim committed f5022be

removed deprecated code

Comments (0)

Files changed (11)

diario/sitemaps.py

-# -*- coding: utf-8 -*-
-#
-#  Copyright (c) 2007-2012 Guilherme Gondim and contributors
-#
-#  This file is part of Django Diário.
-#
-#  Django Diário is free software under terms of the GNU Lesser
-#  General Public License version 3 (LGPLv3) as published by the Free
-#  Software Foundation. See the file README for copying conditions.
-#
-
-from django.contrib.sitemaps import Sitemap
-
-from diario.models import Entry
-
-
-class DiarioSitemap(Sitemap):
-    changefreq = "never"
-    priority = 0.5
-
-    def items(self):
-        return Entry.on_site.visible()
-
-    def lastmod(self, obj):
-        return obj.pub_date

diario/templates/diario/entry_archive_day.html

Empty file removed.

diario/templates/diario/entry_archive_month.html

Empty file removed.

diario/templates/diario/entry_archive_year.html

Empty file removed.

diario/templates/diario/entry_detail.html

Empty file removed.

diario/templates/diario/entry_list.html

Empty file removed.

diario/templatetags/__init__.py

Empty file removed.

diario/templatetags/diario_entries.py

-# -*- coding: utf-8 -*-
-#
-#  Copyright (c) 2007-2012 Guilherme Gondim and contributors
-#
-#  This file is part of Django Diário.
-#
-#  Django Diário is free software under terms of the GNU Lesser
-#  General Public License version 3 (LGPLv3) as published by the Free
-#  Software Foundation. See the file README for copying conditions.
-#
-
-"""
-The ``diario.templatetags.diario_entries`` module defines a number of
-template tags which may be used to work with entries.
-
-To access Diário entries template tags in a template, use the {% load %}
-tag::
-
-    {% load diario_entries %}
-"""
-
-from django import template
-from diario.models import Entry
-
-register = template.Library()
-
-class MonthListNode(template.Node):
-    def __init__(self, var_name):
-        self.var_name = var_name
-
-    def render(self, context):
-        context[self.var_name] = list(Entry.on_site.visible().dates(
-                "pub_date", "month", order="DESC")
-        )
-        return ''
-
-def do_get_diario_month_list(parser, token):
-    """Gets month list that have entries and populates the template context
-    with a variable containing that value, whose name is defined by the 'as'
-    clause.
-
-    Syntax::
-
-        {% get_diario_month_list as [var_name] %}
-
-    Example usage::
-
-        {% get_diario_month_list as archive %}
-
-        {% get_diario_month_list as blog_months %}
-    """
-    bits = token.contents.split()
-    if len(bits) != 3:
-        raise template.TemplateSyntaxError, "'%s' tag takes three arguments" % bits[0]
-    if bits[1] != 'as':
-        raise template.TemplateSyntaxError, "First argument to '%s' tag must be 'as'" % bits[0]
-    return MonthListNode(bits[2])
-
-
-class EntryListNode(template.Node):
-    def __init__(self, num, var_name, start=0):
-        try:
-            self.start = int(start)
-        except ValueError:
-            self.start =  template.Variable(start)
-        self.num = int(num)
-        self.var_name = var_name
-
-    def render(self, context):
-        if type(self.start) != int:
-            try:
-                self.start =  int(self.start.resolve(context))
-            except template.VariableDoesNotExist:
-                return ''
-        context[self.var_name] = Entry.on_site.visible()[self.start:][:self.num]
-        return ''
-
-def do_get_diario_entry_list(parser, token):
-    """
-    Gets entries list and populates the template context with a variable
-    containing that value, whose name is defined by the 'as' clause.
-
-    Syntax::
-
-        {% get_diario_entry_list [num] (from the [start]) as [var_name] %}
-
-    Example usage to get latest entries::
-
-        {% get_diario_entry_list 10 as latest_entries %}
-
-    To get old entries::
-
-        {% get_diario_entry_list 10 from the 10 as old_entries %}
-
-    To get previous entries from the last entry on page with ``last_on_page``
-    context variable provided by ``object_list`` view, do::
-
-        {% get_diario_entry_list 10 from the last_on_page as old_entries %}
-
-    Note: The start point is omitted.
-    """
-    bits = token.contents.split()
-    if len(bits) == 4:
-        if bits[2] != 'as':
-            raise template.TemplateSyntaxError, "Second argument to '%s' tag must be 'as'" % bits[0]
-        return EntryListNode(bits[1], bits[3])
-    if len(bits) == 7:
-        if bits[2] != 'from' or bits[3] != 'the':
-            raise template.TemplateSyntaxError, "Third and fourth arguments to '%s' tag must be 'from the'" % bits[0]
-        if bits[5] != 'as':
-            raise template.TemplateSyntaxError, "Fifth argument to '%s' tag must be 'as'" % bits[0]
-        return EntryListNode(bits[1], bits[6], bits[4])
-    else:
-        raise template.TemplateSyntaxError, "'%s' tag takes three or seven arguments" % bits[0]
-
-
-register.tag('get_diario_entry_list', do_get_diario_entry_list)
-register.tag('get_diario_month_list', do_get_diario_month_list)

diario/urls/__init__.py

Empty file removed.

diario/urls/entries.py

-# -*- coding: utf-8 -*-
-#
-#  Copyright (c) 2007-2012 Guilherme Gondim and contributors
-#
-#  This file is part of Django Diário.
-#
-#  Django Diário is free software under terms of the GNU Lesser
-#  General Public License version 3 (LGPLv3) as published by the Free
-#  Software Foundation. See the file README for copying conditions.
-#
-
-
-"""
-URL definitions for weblog entries.
-"""
-
-from django.conf.urls.defaults import *
-
-from diario.feeds import entries as feeds
-from diario.feeds import comments as comment_feeds
-from diario.views import entries as views
-
-
-entry_list = url(
-    regex  = '^$',
-    view   = views.EntryList.as_view(),
-    name   = 'diario-entry-list'
-)
-
-entry_detail = url(
-    regex  = '^(?P<year>\d{4})/(?P<month>[0-9]{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
-    view   = views.EntryDetail.as_view(),
-    name   = 'diario-entry'
-)
-
-
-archive_day = url(
-    regex  = '^(?P<year>\d{4})/(?P<month>[0-9]{2})/(?P<day>\d{2})/$',
-    view   = views.EntryArchiveDay.as_view(),
-    name   = 'diario-archive-day'
-)
-
-archive_month = url(
-    regex  = '^(?P<year>\d{4})/(?P<month>[0-9]{2})/$',
-    view   = views.EntryArchiveMonth.as_view(),
-    name   = 'diario-archive-month'
-)
-
-archive_year = url(
-    regex  = '^(?P<year>\d{4})/$',
-    view   = views.EntryArchiveYear.as_view(),
-    name   = 'diario-archive-year'
-)
-
-
-entries_atom = url(
-    regex = '^atom/$',
-    view  = feeds.AtomEntriesFeed(),
-    name  = 'diario-entry-atom'
-)
-
-entries_rss = url(
-    regex = '^rss/$',
-    view  = feeds.RssEntriesFeed(),
-    name  ='diario-entry-rss'
-)
-
-
-entry_comments_atom = url(
-    regex = '^(?P<year>\d{4})/(?P<month>[0-9]{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/atom/$',
-    view  = comment_feeds.AtomCommentsByEntryFeed(),
-    name  = 'diario-entry-comments-atom'
-)
-
-entry_comments_rss = url(
-    regex = '^(?P<year>\d{4})/(?P<month>[0-9]{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/rss/$',
-    view  = comment_feeds.RssCommentsByEntryFeed(),
-    name  ='diario-entry-comments-rss'
-)
-
-
-urlpatterns = patterns('',
-    entry_list, entry_detail,
-    archive_day, archive_month, archive_year,
-    entries_atom, entries_rss,
-    entry_comments_atom, entry_comments_rss
-)

diario/urls/entries_by_author.py

-# -*- coding: utf-8 -*-
-#
-#  Copyright (c) 2009-2012 Guilherme Gondim and contributors
-#
-#  This file is part of Django Diário.
-#
-#  Django Diário is free software under terms of the GNU Lesser
-#  General Public License version 3 (LGPLv3) as published by the Free
-#  Software Foundation. See the file README for copying conditions.
-#
-
-"""
-URL definitions for weblog entries divided by author.
-"""
-
-from django.conf.urls.defaults import *
-
-from diario.feeds import entries_by_author as feeds
-from diario.views import entries_by_author as views
-
-
-# TODO: AuthorListView
-# author_list = url(
-#     regex  = '^$',
-#     view   = views.AuthorListView.as_view(),
-#     name   = 'diario-author-list',
-# )
-
-entry_list_by_author = url(     # entries by author
-    regex  = '^(?P<username>[^/]+)/$',
-    view   = views.EntryListByAuthor.as_view(),
-    name   = 'diario-author-entry-list',
-)
-
-
-entries_by_author_atom = url(
-    regex = '^(?P<username>[^/]+)/atom/$',
-    view  = feeds.AtomEntriesByAuthorFeed(),
-    name  = 'diario-author-entry-atom'
-)
-
-entries_by_author_rss = url(
-    regex = '^(?P<username>[^/]+)/rss/$',
-    view  = feeds.RssEntriesByAuthorFeed(),
-    name  = 'diario-author-entry-rss'
-)
-
-
-urlpatterns = patterns('',
-    entry_list_by_author,
-    entries_by_author_atom, entries_by_author_rss
-)