Fixed displaying entries by category
authorEriol
Tue, 27 Nov 2012 04:51:49 +0100
changeset 812b329261c8f3
parent 80 91bcd82c2445
child 82 2f83c6cbc3ef
Fixed displaying entries by category
blog/templates/blog/category_detail.html
blog/templates/blog/category_list.html
blog/urls.py
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/blog/templates/blog/category_detail.html	Tue Nov 27 04:51:49 2012 +0100
     1.3 @@ -0,0 +1,10 @@
     1.4 +{% extends "base_blog.html" %}
     1.5 +
     1.6 +{% block title %}{{ block.super }} | Entries in "{{ object.name|escape }}"{% endblock %}
     1.7 +
     1.8 +{% block content %}
     1.9 +    {% for entry in object.live_entries %}
    1.10 +        {{ entry.body|truncatewords_html:"20"|safe }}
    1.11 +        <a href="{{entry.get_absolute_url}}">Permalink</a>
    1.12 +    {% endfor %}
    1.13 +{% endblock %}
    1.14 \ No newline at end of file
     2.1 --- a/blog/templates/blog/category_list.html	Tue Nov 27 02:05:39 2012 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,10 +0,0 @@
     2.4 -{% extends "base_blog.html" %}
     2.5 -
     2.6 -{% block title %}{{ block.super }} | Entries in "{{ object.name|escape }}"{% endblock %}
     2.7 -
     2.8 -{% block content %}
     2.9 -    {% for entry in object.live_entries %}
    2.10 -        {{ entry.body|truncatewords_html:"20"|safe }}
    2.11 -        <a href="{{entry.get_absolute_url}}">Permalink</a>
    2.12 -    {% endfor %}
    2.13 -{% endblock %}
    2.14 \ No newline at end of file
     3.1 --- a/blog/urls.py	Tue Nov 27 02:05:39 2012 +0100
     3.2 +++ b/blog/urls.py	Tue Nov 27 04:51:49 2012 +0100
     3.3 @@ -6,7 +6,7 @@
     3.4      MonthArchiveView,
     3.5      DayArchiveView
     3.6  )
     3.7 -from django.views.generic.list import ListView
     3.8 +from django.views.generic.detail import DetailView
     3.9  
    3.10  
    3.11  from blog.feeds import LatestEntriesFeed, CategoryFeed
    3.12 @@ -23,7 +23,6 @@
    3.13  
    3.14  category_info = {
    3.15      'queryset': Category.objects.all(),
    3.16 -    'paginate_by': 10,
    3.17  }
    3.18  
    3.19  
    3.20 @@ -44,7 +43,7 @@
    3.21          name='blog_entry_detail'),
    3.22  
    3.23      url(r'^category/(?P<slug>[-\w]+)/$',
    3.24 -        ListView.as_view(**category_info),
    3.25 +        DetailView.as_view(**category_info),
    3.26          name='blog_category_detail'),
    3.27  
    3.28      # Feeds