Code Monkey home page Code Monkey logo

django-pagination's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-pagination's Issues

Disable page_suffix

How to disable page_suffix parameter?
I'm just want PAGE=1, not PAGE_OBJECT=1...

Two autopaginate tags, paginator object gets confused

Hope I get this described right, but we have a situation where we need two different
{% autopaginate foo %} tags. They're in different blocks (of template) so Django can't
pass the result from one block to another and that's why we do it like we do.

The first time around everything's nice, num_pages is eg. 8. The second time it's 1.

Iterating over paginator.object_list (edit: page_obj.object_list of course) doesn't seem
broken, but it's as if all the numeric states get reset.

The second autopaginate is inside a script tag, so I tried /* {% paginate %} */ with
no effect.

There is a paginator object in the context at that time, so is there some magic
that destroys its state or whatever?

About test_project folder

A code in the folder linaro_django_pagination/test_project/ is not currently using in tests. May be it should be removed?

Infinite Pagination improvements

It's probably completely incompatible with your version as it is so I won't submit a pull request, but there are some nice changes to InfinitePagination, including using it directly from the templatetag, in our fork here: https://github.com/liberation/django-pagination/

(most changes come from https://github.com/rizumu/django-pagination/tree/add_backwards_option but we added a couple of nice improvements)

I don't have the time to work on adapting the changes to your fork at the moment, so I'm submitting this issue in case someone else has :-)

Release latest on PyPI

Any chance a new release could be submitted to PyPI? The alternative is to do an in-house release, which isn't super ideal.

Package not installable

The package has an install-time dependency on the versiontools package. This means it can't be installed into a clean environment using pip, easy_install, buildout etc.

setup.py shouldn't require versiontools to be installed.

Add TravisCI support

We should take advantage of TravisCI and test trunk and all the merge requests automatically.

New maintainer wanted

Hello

I don't have time to maintain or release this project. If anyone wants to help or take over please respond below!

Wrong window count

templatetags/pagination_tags.py:283

window_start = window_start - (window_end - paginator.num_pages)

window_start can easily become negative and that leads to wrong page range below:

pages = page_range[window_start:window_end]

I propose to add max() func:

window_start = max(0, window_start - (window_end - paginator.num_pages))

Pain in transitioning

I understand the desire to make this branch distinct from upstream, but perhaps the decision to re-name the module to linaro_django_pagination could be revisited? It's way too much work for us to transition our projects to this fork, since we have a lot of code that imports the old pagination stuff for custom work.

It's perfectly valid to name the top-level package the same as the original django-pagination, and would very likely get some people to make the jump to this fork instead of one of the handful of others doing the same thing.

Just my opinion, figured I'd share!

Accessing the last page

Hello,
is there a tag, something usable in the django-pagination package to access the number of the last page ?

Remove django as dependency

Since the way this works with pip which will typically re-download django even though you already have it installed it.

pip install git+git://github.com/zyga/django-pagination.git -U
Downloading/unpacking git+git://github.com/zyga/django-pagination.git
  Cloning git://github.com/zyga/django-pagination.git to /tmp/pip-Jdz1s4-build
  Running setup.py egg_info for package from git+git://github.com/zyga/django-pagination.git

    Installed /tmp/pip-Jdz1s4-build/versiontools-1.8-py2.7.egg

Downloading/unpacking django>=1.2 (from linaro-django-pagination==2.0.2)
  Downloading Django-1.3.1.tar.gz (6.5Mb): 6.5Mb downloaded
  Running setup.py egg_info for package django

Installing collected packages: django, linaro-django-pagination
  Found existing installation: Django 1.3
    Uninstalling Django:
      Successfully uninstalled Django
  Running setup.py install for django
        changing mode of build/scripts-2.7/django-admin.py from 644 to 755

    changing mode of /home/simon/src/trafo/ve/bin/django-admin.py to 755
  Running setup.py install for linaro-django-pagination

Successfully installed django linaro-django-pagination
Cleaning up...

Installation problems

On OS X with Python 2.6.1 and pip 1.0.2, I'm getting the following error when attempting to install linaro-django-pagination in a virtualenv:

Traceback (most recent call last):
File "", line 14, in
File "/Users//virtualenvs/consolidated2/src/linaro-django-pagination/setup.py", line 35, in
include_package_data=True
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 260, in init
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 284, in fetch_build_eggs
File "build/bdist.linux-i686/egg/pkg_resources.py", line 563, in resolve
plugin_projects = list(plugin_env)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 799, in best_match
File "build/bdist.linux-i686/egg/pkg_resources.py", line 811, in obtain
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 327, in fetch_build_egg
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in
File "setup.py", line 29, in
tests_require=[
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 354, in format_version
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 183, in from_tuple
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 126, in new
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 279, in _find_source_tree
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 936, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 14, in
File "/Users//virtualenvs/consolidated2/src/linaro-django-pagination/setup.py", line 35, in
include_package_data=True
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 260, in init
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 284, in fetch_build_eggs
File "build/bdist.linux-i686/egg/pkg_resources.py", line 563, in resolve
plugin_projects = list(plugin_env)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 799, in best_match
File "build/bdist.linux-i686/egg/pkg_resources.py", line 811, in obtain
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 327, in fetch_build_egg
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in
File "setup.py", line 29, in
tests_require=[
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 354, in format_version
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 183, in from_tuple
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 126, in new
File "/var/folders/+e/+e-fXew0EJmWDLZpODM0IU+++TM/-Tmp-/easy_install-quDYyr/versiontools-1.8.1/versiontools/init.py", line 279, in _find_source_tree
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 936, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range

I'll continue to troubleshoot and post back if I find a resolution.

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.