Git Product home page Git Product logo

django-pagination's People

Contributors

alcides avatar artofhuman avatar barttc avatar brosner avatar carljm avatar ericflo avatar hedleyroos avatar leah avatar mpasternak avatar rbas avatar spookylukey avatar tiagosamaha avatar tzangms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-pagination's Issues

feature request -- instead of raising 404 work with modulo

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.

HashTag as None, causes django pagination not working

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=''):

locale folder is not included when installing with pip (since version 1.0.6)

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

Create a new release for current version.

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!

InfinitePagination/FinitePagination howto

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.

PAGINATION_INVALID_PAGE_RAISES_404 does not work

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.

no STATIC_URL in context w/ django 1.3?

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.

Tests fail

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,

Spanish translation fail

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

Can't work on Django==1.8.6

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.

Pagination templatetags within blocks

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 %}

Sort - bootstrap-pagination

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,

Nested object loops

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

Broken except clause in paginate() causes 500s on invalid pages when used with a generic view

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

locals nl

SOME DESCRIPTIVE TITLE.

Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER

This file is distributed under the same license as the PACKAGE package.

FIRST AUTHOR EMAIL@ADDRESS, YEAR.

, fuzzy

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"

: templates/pagination/pagination.html:5

: templates/pagination/pagination.html:7

msgid "previous"
msgstr "vorige"

: templates/pagination/pagination.html:21

: templates/pagination/pagination.html:23

msgid "next"
msgstr "volgende"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.