2006/1/4, EricHsu <[EMAIL PROTECTED]>: > > guys, I did it by hacking into django's list_detail.py > > just add a simply line here: > > $ svn diff list_detail.py > Index: list_detail.py > =================================================================== > --- list_detail.py (revision 1813) > +++ list_detail.py (working copy) > @@ -58,6 +58,7 @@ > 'next': page + 1, > 'previous': page - 1, > 'pages': paginator.pages, > + 'pages_list': range(1, paginator.pages + 1), > 'hits' : paginator.hits, > }, context_processors) > else: > > > then, I can access the pages_list (a real list:) from my template: > > {% if is_paginated %} > <div class="pages"> > {% for page_number in pages_list %} > <a href="./?page={{ forloop.counter0 }}">{{ page_number }}</a> > {% endfor %} > </div> > {% endif %} > > Could I submit this line of code into django's source? hehe > > I think create a range filter may be better. May be someone don't need pages_list。But range is more generic.
-- I like python! My Blog: http://www.donews.net/limodou NewEdit Maillist: http://groups.google.com/group/NewEdit