This project is no longer maintained.
A maintained fork of this project is available at: https://github.com/pydanny/dj-pagination
A set of utilities for creating robust pagination tools throughout a django application.
Home Page: http://code.google.com/p/django-pagination/
License: BSD 3-Clause "New" or "Revised" License
This project is no longer maintained.
A maintained fork of this project is available at: https://github.com/pydanny/dj-pagination
The django packages site misses some information about django-pagination.
Please update the comparison: https://www.djangopackages.com/grids/g/pagination/
Thank you.
I've discovered a case where pagination produces 'mulitple paginate navs' when paginating over a nested loop of objects.
In my working case I have:
event_dates (datetime)
events ('which fall on event_dates')
producing a list that looks like:
Monday 1st Jan
Event 1 (starts)
Event 2 (one day only)
Tuesday 2nd Jan
Event 1 (continues)
Event 3
Wednesday 3rd Jan
Event 1 (ends)
In a sort of 'daily agenda' fashion.
Pagination 'appears' correct on the first page, however, on the 'last' it seems to be trying to 'paginate' the nested objects, in this case the 'events' as well, an yields 2 or more nested 'pagination navs'
I haven't tested the 'in-between' pages as yet.
Bests
hi,
if an invalid page 'page_number' is requested you could say current_page = page_number mod max_pages this would make PAGINATION_INVALID_PAGE_RAISES_404 obsolete.
if you would accept such a feature request, I could make a fork and implement it. please just write "yes" or "no". thanks.
I'd really like to use the InfinitePagination feature from pagination.py. I've tried everything I can think of to no avail. Can anyone explain how to set this up? In addition, usage instructions in the docs would be most helpful.
I kept pagination setup the default way, using autopaginate and paginate:
{% autopaginate object_list 12 %}
.....
{% paginate %}
Also just to verify, I changed pagination_tags.py (line 99) to use InfinitePaginator, since it wasn't clear if it was actually being retrieved from my view's response context or not.
paginator = InfinitePaginator(value, paginate_by, self.orphans)
Thanks in advance.
I use this software and our legal page attributes the correct license. I'm writing a dynamic way of getting the licenses for current versions of the packages we use. One of the strategies is pulling the LICENSE
file for a given version from release branches on github or whatever hosting provider the project in question is using.
Currently, the latest (and only) release branch tagged on this project is 1.0.6, even though the PyPI package and commit comments indicate that 1.0.7 is the latest version. A simple version bump tag would be in order.
Thank you for your time!
Is there an easy way to add column sorting support to the paginator as well?
I'd like to do it in the bootstrap version, but can't find a link to add issues/requests to that fork.
Thanks,
MEDIA_URL gets set, however STATIC_URL does not. With django 1.3 shipping with staticfiles now, it would make sense to add this into the context of the template.
Hello,
I get error information after installed on django 1.8.6:
(I sure that setting.py is right, and can import TOKEN_BLOCK from command line )
'pagination_tags' is not a valid tag library: ImportError raised loading pagination.templatetags.pagination_tags: cannot import name TOKEN_BLOCK.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-03-16 16:26+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME EMAIL@ADDRESS\n"
"Language-Team: LANGUAGE [email protected]\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "previous"
msgstr "vorige"
msgid "next"
msgstr "volgende"
When i install django-pagionation with pip install django-pagination
the locale folder is not included.
The last version where it works is 1.0.5 (pip install django-pagination==1.0.5
). In this case the german, french and polish files are included.
Is there any reason for this behaviour?
Thank you
Andreas
The except clause wrapping all of paginate() says "except KeyError, AttributeError:". This is broken (needs parens), so AttributeErrors are not actually caught. The symptom of this is that if you use pagination in a template rendered by generic view, and request an invalid page, you get a 500 from an AttributeError in the line "page_range = paginator.page_range".
This only shows up if you use a generic view because a generic view will set the context var "paginator" to None. Without the generic view you get a KeyError two lines earlier, which is caught by the except clause.
Fix for this is in my fork: http://github.com/carljm/django-pagination/commit/2a44e0ac284e3f1ad0c8a7281344674e34a42718
Hi there, is django-pagination ready with Spanish translation?, im using the last version and nothing happen with this language, there's always English
Thanks you
http://code.google.com/p/django-pagination is still the official repository and some issues are here, some are there. It would be great to get everything over here so that everybody knows the current status of things.
If you set PAGINATION_INVALID_PAGE_RAISES_404 to True, the autopaginate call does indeed raise Http404, but this is then caught by a catchall "except Exception" in Django's template system, resulting in a debug page, or a 500 error in production.
Not sure what the solution is here; short of patching Django, seems like template tags can't raise 404.
Does not work with python 3.4 and Django > 1.8
I have my own pagination.html template that I styled for my project. When I run the tests, it fails because it's trying to use my template and the expected results don't match.
Test seem to pass when there is no pagination/pagination.html in templates.
Thanks,
It would be nice to specify different templates for pagination, so there is not only one site-wide pagination template.
I added the new template_tag {% paginate_with_template 'template_name' %} in my fork to accomplish this. You can find it here:
http://github.com/bjunix/django-pagination/commit/6a9d4d8fa7a49bc86260b679a816423ba6123027
Maybe this is also helpful for others.
I am not sure whether i saw in this in the docs.
How can one acheive this?
Would be worth noting that in updated object list is not preserved in different blocks:
{% extends "base.html" %}
{% load pagination_tags %}
{% block body %}
{% autopaginate object_list %}
{% for object in object_list %}
{{ object }}
{% endfor %}
{% endblock %}
{% block sidebar %}
{# this would not work without calling autopaginate again #}
{% autopaginate object_list %}
{% paginate %}
{% endblock %}
On def paginate(context, window=DEFAULT_WINDOW, hashtag=None):
resulting a ?page=2None in my code and lost pagination functionality, i recommend this changed to
def paginate(context, window=DEFAULT_WINDOW, hashtag=''):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.