views:

196

answers:

0

Hi guys, i would like to paginate my object list, im tring to use django-pagination, but is showing a 404 page no found when i try to navigate.

ulr.py

categoria_info = {
        'queryset':Categoria.objects.all(),    
}


urlpatterns = patterns('',
                        url(r'^$',
                            object_list,
                            categoria_info,
                            name = 'categoria_list'
                            ),                    
                        url(r'^(?P<parent>[-\w]+)/(?P<child>[-\w]+)/',

                            noticias_categoria,
                            name='noticia_detail',                            
                            ),
                        url(r'^(?P<parent>[-\w]+)/$',
                            index,
                            name='noticia_detail'
                            ),
                       )

template.html

<h1>{{ categoria.titulo }}</h1>

{% if object_list.count %}
<ul id="listar">
{% autopaginate object_list 5 %}
      {% for noticia in object_list %}
        <li> {% if noticia.imagen %}
            <span class="img"><img src="{% thumbnail noticia.imagen 50x50 crop upscale %}"  alt="{{ noticia.titulo }}" title="{{ noticia.titulo }}"/></span>
        {% endif %}
        <span class="fecha" >{{ noticia.pub_date|date:"F l d" }}</span> 
        <h2><a href="{{ noticia.get_absolute_url }}">{{ noticia.titulo }}</a></h2> </li>
      {% endfor %}
      {% paginate %}
      </ul>

    {% else %}
     <h2>No existen articulos</h2>
    {% endif %}

Any idea?

Thanks :)