Esempio n. 1
0
 def items(self, item):
     return TaggedItem.objects.get_by_model(get_latest_entries(), item)[:settings.RSS_LIMIT]
Esempio n. 2
0
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from django.conf import settings
from django.conf.urls import patterns, url
from django.views.generic.dates import DayArchiveView, DateDetailView, MonthArchiveView
from django.views.generic.list import ListView

from feeds import *
from functions import get_latest_entries

urlpatterns = patterns('raptiye.blog.views',
    # main page of blog
    url(r'^$', ListView.as_view(**{
        'queryset': get_latest_entries(),
        'template_name': '%s/homepage.html' % settings.TEMPLATE_NAME,
        'paginate_by': settings.ENTRIES_PER_PAGE,
        'context_object_name': 'entries'
    }), name='index'),

    # archives for blogs..
    # url(r'^(?P<year>\d{4})/$', 'get_entries_for_year', name='entries_in_year'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$', MonthArchiveView.as_view(**{
        'queryset': get_latest_entries(),
        'date_field': 'datetime',
        'month_format': '%m',
        'allow_empty': True,
        'context_object_name': "entries",
        'allow_future': True,
        'paginate_by': settings.ENTRIES_PER_PAGE,
Esempio n. 3
0
 def items(self):
     return get_latest_entries()[:settings.RSS_LIMIT]