Code Monkey home page Code Monkey logo

django-pagination's People

django-pagination's Issues

sorted() vs sort()

Hi everyone,
I'm having some problems related to the python version that is running on my 
server.

At the moment is python 2.3 and the pagination app is giving me a lot of 
problems because it uses 
sorted(), which is included in python 2.4+but not python 2.3.
Since Django is python 2.3 compatible, can you please make yout app compatible 
as well?
It's quite easy actually, just a couple of lines.

Thanks in advance!
David

Original issue reported on code.google.com by [email protected] on 3 Sep 2008 at 4:23

Missing setup.py

django-pagination lacks a setup.py file, making it difficult to use in an
egg-based deployment.

(Even better would be a proper release onto PyPI!)

Original issue reported on code.google.com by dan.fairs on 19 Oct 2008 at 6:11

Problem with Posts Form data.

When used with a view (for a search form) that uses Posts the first page is
fine, but the clicking on any of the paginator links just returns the view
of the form, not the results of the search. 

This is because a GET is being used.

Should perhaps clarify in the documentation that only GETS are supported. 

Thanks,


Original issue reported on code.google.com by [email protected] on 15 Jan 2009 at 12:36

Caught an exception while rendering: 'request'

What steps will reproduce the problem?
1. I have installed django-pagination1.0.5 
2. Modified settings.py accordingly to the video tutorial
3. wrote my template code 

What is the expected output? What do you see instead?
expected output - paginated results 

What version of the product are you using? On what operating system?
django-pagination1.0.5 on windows xp

Please provide any additional information below.
the error i got is :
Caught an exception while rendering: 'request'

Original Traceback (most recent call last):
  File "C:\Python25\lib\site-packages\django\template\debug.py", line 71,
in render_node
    result = node.render(context)
  File
"c:\python25\lib\site-packages\django_pagination-1.0.5-py2.5.egg\pagination\temp
latetags\pagination_tags.py",
line 90, in render
    page_obj = paginator.page(context['request'].page)
  File "C:\Python25\lib\site-packages\django\template\context.py", line 43,
in __getitem__
    raise KeyError(key)
KeyError: 'request'

Below i list my template code:

<ul>
  {%if row %} 
     {%autopaginate row 4 %}
        {% for item in row %}
            <li>{{ item }}</li>
        <br>
        {% endfor %}
     {% paginate %}
  {% endif %}
</ul>

Original issue reported on code.google.com by [email protected] on 9 Apr 2009 at 11:22

pagination changes the order of my results

The pagination changes the order if the items from my object_list. I sent a
list with contains a set of movies whom has to be displayed to the user in
a particular order but pagination changed the order (i cannot figure out if
it did an order on a particular property)

Has anyone noticed that? Is there a workaround? I cannot figure out from
the code what can change the order of my items...

Thank you very much!

Regards,
Dorian

Original issue reported on code.google.com by [email protected] on 27 Jan 2009 at 3:49

diffrent blocks == error

{% block foo %}
 {% autopaginate object_list 2 %}
  {% for do something %}
     ...
  {% endfor %}
{% endblock %}
{% block bar %}
    {% paginate %}
{% endblock %}

results in errors!
Caught an exception while rendering: 'NoneType' object has no attribute
'page_range'


Maybe I'm doing something wrong.

Original issue reported on code.google.com by onno%[email protected] on 24 Nov 2008 at 1:05

TypeError raised - neeeds to be incorporated into Except List

What steps will reproduce the problem?
1. start application (pinax in this case) with python manage.py runserver ...
2. point your browser to address 

What is the expected output? What do you see instead?
Expected: webpage
Instead:  raw Errormessage - not handled by Django telling
TypeError: 'WSGIRequest' object is unsubscriptable


What version of the product are you using? On what operating system?
Trunk Pinax

Please provide any additional information below.
Extending middleware.py with TypeError

line 9     except (KeyError, ValueError, TypeError):

fixed the problem

rgds
g 

Original issue reported on code.google.com by [email protected] on 3 Aug 2008 at 9:25

Using Paginator is harmful for querysets

Hi,

I think usage of django.core.paginator.Paginator is improper in
pagination_tags.py

Paginator class uses len(object) for counting number of objects in
queryset. So, queries like Article.objects.all() in view, will run very slooow.

I changed the Line 67 of pagination_tags.py to use QuerySetPaginator, and
result is as expected.

Original issue reported on code.google.com by [email protected] on 12 Oct 2008 at 7:58

css classname with spaces!

Hi!
the css class for the current page has a space.. this is not a valid css name.

example: <span class="current page">3</span>

another "issue": the names of the classes are very generic and it can
generate conflicts with another class names, can they have a prefix or similar?

Thanks!!

pd: i attach the file with my suggestions ;)

Original issue reported on code.google.com by [email protected] on 24 Jul 2008 at 1:48

Attachments:

"Show X records" <select> feature?

Can django-pagination be set to use dynamic number of rows ?
I assume it's {% autopaginate object_list X %}

Let's say there's a table and I would like to have "Show X records"
<select> displayed.

Thanks for the project!

Original issue reported on code.google.com by [email protected] on 14 Nov 2008 at 5:28

Remove support for depreciated QuerySetPaginator

Paginator and QuerySetPaginator are now the same thing, so there is no need
for QuerySet detection. This line:

value = list(value)

also kills any lazy loading objects that are not QuerySets (djangosearch,
django-sphinx etc), making it impractical to use them with django-pagination.

I have attached a patch which should fix both issues.

Original issue reported on code.google.com by [email protected] on 29 Aug 2008 at 12:29

Attachments:

Documentation doesn't mention TEMPLATE_CONTEXT_PROCESSORS step

The README doesn't mention that users of django-pagination need to add the
TEMPLATE_CONTEXT_PROCESSORS list to their settings.py and make certain that
the request context_processor is in the list.

The screencast does demonstrate this step, though.

Original issue reported on code.google.com by [email protected] on 17 Jul 2008 at 4:24

autopagione additional paramer - paginated queryset context variable name

Current use of autopaginate tag expects existing separate queryset
variable. But in my case I didn't have variable. I had a function. In
another words I should write following:

{% autopaginate object.image_set.all %}

But how to iterate over result?
So I added one more parameter to this tag and used it in another way:

{% autopaginate object.image_set.all as images %}

And than I can iterate over "images".

The patch is attached. I hope it will help to improve your app. Thanks.

Original issue reported on code.google.com by [email protected] on 15 Sep 2008 at 9:11

Attachments:

Caught an exception while rendering: 'request'

I'm getting 

Caught an exception while rendering: 'request'

Original Traceback (most recent call last):
  File "/Users/xx/django/template/debug.py", line 71, in render_node
  File
"/Users/xx/django-pagination-svn-trunk/pagination/templatetags/pagination_tags.p
y",
line 69, in render
    page_obj = paginator.page(context['request'].page)
  File "/Users/xx/django/template/context.py", line 43, in __getitem__
KeyError: 'request'

error,

Original issue reported on code.google.com by [email protected] on 4 Oct 2008 at 9:35

Caught an exception while rendering: 'request'

What steps will reproduce the problem?
1. Installed django-pagination
2. followed steps for setup
3. watched tutorial and set up settings.py exactally like the video

What is the expected output? What do you see instead?
Expected to see page templated rendered with 25 results. Instead I get the
error message "Caught an exception while rendering: 'request'"

What version of the product are you using? On what operating system?
Using verison 1.0.5 on Windows Vista

Please provide any additional information below.

I followed the advice in Issue 20 and added "from django.template import
RequestContext" to the view.py and 'django.core.context_processors.request'
is added in Template_Context_Processors. I have no idea why this is not
working.

Here is my template

11      
12  <p>The number of records: {{lobbyists|length}} </p>
13  
14  {% endif %}
15  
16  <p> This table contains all firms and individuals who lobbied on behalf
of {{country}}.</p>
17  
18  <table border ="2">
19  
20  <th>Firm</th><th>Client</th><th>Country</th><th>Amount</th><th>Type of
Lobbying</th><th>Year</th>
21  {% autopaginate lobbyists 25 %}
22  {% for lobbyist in lobbyists %}
23  <tr>
24  <td><a
href="{{lobbyist.reg_cd.get_absolute_url}}">{{lobbyist.reg_cd}}</a></td>
25  <td><a
href="{{lobbyist.fp_cd.get_absolute_url}}">{{lobbyist.fp_cd}}</a></td>
26  <td>{{lobbyist.country}}</td>
27  <td>{{lobbyist.financial_amount}}</td>
28  <td><a
href="{{lobbyist.act_type.get_absolute_url}}">{{lobbyist.act_type}}</a></td>
29  <td>{{lobbyist.year}}</td>
30  </tr>
31  

Original issue reported on code.google.com by [email protected] on 23 Apr 2009 at 3:02

rename pypi entry to django-pagination

I propose to rename the distutils/setuptools package of django-pagination from 
"pagination" to 
"django-pagination". That would allow to type easy_install django-pagination.

See also the list of other apps already registered under that name prefix:
http://pypi.python.org/pypi?%3Aaction=search&term=django-


Original issue reported on code.google.com by leidel on 25 Oct 2008 at 4:07

AttributeError when out of range

What steps will reproduce the problem?
1. {% autopaginate object_list 10 %} + {% paginate %}
2. only 9 objects
3. got to ?page=2 or 0, only 1 works

What is the expected output? What do you see instead?
'NoneType' object has no attribute 'page_range'
the error only occurs when i use {% paginate %}

What version of the product are you using? On what operating system?
svn from today (28.7.2008)

Please provide any additional information below.
this is not a crucial bug, but imho a site should be safe against wrong GET
paramters ;))
except this little but, a very nice piece of software. thanks!

Original issue reported on code.google.com by [email protected] on 28 Jul 2008 at 10:57

Paginator returns a full object list if the page number is invalid

If you type an invalid page number (e.g. ?page=3450) the paginator returns
the full list of objects. I would suggest to return an empty list and a key
like "invalid_page" to mark it.

So my template looks like this now:

    {% autopaginate object_list 10 %}
    {% if invalid_page %}
        This page does not exists (anymore).
    {% endif %}    
    ... display object list ...
    {% paginate %}

Also the paginator fails if somebody uses strings as a page number. In this
case the default page number should be "1".

Original issue reported on code.google.com by [email protected] on 4 Jul 2008 at 10:19

Attachments:

django-pagination causes 500 error on invalid page

What steps will reproduce the problem?
1. Install django-pagination as documented
2. Navigate to an invalid page number

What is the expected output? What do you see instead?

If django-pagination is installed according to the documentation, you will
see a 500 error (TemplateSyntaxError).  What you should see instead is,
perhaps, arguable.

In issue 1 the fix chosen was to set an (undocumented) context variable
"invalid_page".  If this is the preferred route, the use of that context
variable needs to be clearly documented in the usage docs, as the standard
setup of django-pagination should not open up a site to 500 errors.

In my opinion, the fix for issue 1 was insufficient, as it's ugly to always
have to include invalid_page-checking boilerplate in any template that uses
django-pagination.  I would prefer to see an invalid page simply return the
first page instead.

Some options I see:

1. Invalid page returns first page.  Very easy to use, idiot-proof. 
Backwards-incompatible

2. Keep current behavior, but add documentation of invalid_page context
variable.  Makes templates using pagination uglier and more complex than
they need to be if you want to avoid 500s.

3. Introduce a setting to choose between 1 and 2. 

What version of the product are you using? On what operating system?

Most recent SVN trunk, with Django 1.0.x branch.

Please provide any additional information below.

I'm happy to write a patch for any of the above solutions, once one of them
is chosen.

Original issue reported on code.google.com by carl.j.meyer on 6 Nov 2008 at 4:27

replace "&" with "&amp;" in urls

in pagination_tags.py:
  to_return['getvars'] = "&%s" % getvars.urlencode()
should be:
  to_return['getvars'] = "&amp;%s" % getvars.urlencode()

Original issue reported on code.google.com by [email protected] on 25 May 2009 at 9:41

Should use request.REQUEST for accessing request's data, as of [8202].

What steps will reproduce the problem?
1. Use Django after revision 8202

What is the expected output? What do you see instead?

  File "E:\Software\workspace\django-pagination\pagination\middleware.py",
line 8, in process_request
    request.page = int(request['page'])

TypeError: 'WSGIRequest' object is unsubscriptable


What version of the product are you using? On what operating system?
django-pagination r23

Please provide any additional information below.

Since [8202], to access data in GET or POST, you need to do
request.REQUEST['myvar'] instead of request['myvar']
http://code.djangoproject.com/changeset/8202

Patch attached.

Original issue reported on code.google.com by [email protected] on 4 Aug 2008 at 12:16

Attachments:

Documentation: clarify placement of "autopaginate" tag

In order for the ``render'' method to be called on AutoPaginateNode, the
``{% autopaginate object_list %}'' tag must be placed in a section of a
template that is rendered.  A common case where a tag might be placed in a
non-rendered area is if you are using template inheritance.  For example,
the following does not work:

{{{
{% extends "base.html %}
{% load pagination_tags
{% autopaginate object_list %}
{% block body %}
{% for object in object_list %}
...
{% endfor %}
{% endblock %}
}}}

Instead, the autopaginate tag must be moved inside the "body" block to
work.  Since the autopaginate tag doesn't output anything (it simply
changes the context), this restriction isn't automatically intuitive.

Simply clarifying this in the documentation should be sufficient, if there
isn't a good way to make the tag function without "render" getting called.

Original issue reported on code.google.com by [email protected] on 27 Mar 2009 at 10:30

autopaginate tag makes queryset not lazy with django.views.generic.list_detail.object_list

I use object_list view with dict like:
posts_dict={
        'queryset': Post.objects.all(),
        'template_name': 'galgather/posts_archive.html',
        'allow_empty':True,
        'template_object_name':'posts',
        }

In my template I use:
{% autopaginate posts_list 20 %}
{% pagination %}

Request for every page triggers query which fetches all instances of my 
post model every time instead of expected 20 of them - in SQL there's no 
LIMIT and OFFSET statements.

While I was testing django builtin Pagination object as described at
http://docs.djangoproject.com/en/dev/topics/pagination/#topics-pagination
it works well - queries include LIMIT and OFFSET

I use:
postgresql-8.3.5
django-1.0.2
django-pagination revision 46

Some more detailed information about my model is at
http://groups.google.com/group/django-users/browse_thread/
thread/8245495741aa34e5#

Original issue reported on code.google.com by [email protected] on 5 Feb 2009 at 7:49

Pagination does not work on MSSQL 2005 for more than 101 rows

What steps will reproduce the problem?
1. On Django connected to MSSQL 2005 put for more than 101 rows to result.
2. It returns "Cannot create new connection because in manual or
distributed transaction mode"
3. Add "MultipleActiveResultSets=true" to connection string and still
return "Cannot create new connection because in manual or distributed
transaction mode"

What version of the product are you using? On what operating system?
Win 2003 server
MSSQL 2005
django-pagination-1.0.4
Python 2.6.1 and Python 2.5.2 (same result)
Django 1.0.2
Newest version of sqlserver_ado 


Brano

Original issue reported on code.google.com by [email protected] on 10 Jan 2009 at 4:59

Addition to the "How to use django-pagination" doc

The "How to use django-pagination" doc, linked from the wiki, should
mention the need to add 'django.core.context_processors.request' to the
TEMPLATE_CONTEXT_PROCESSORS setting, commented out by default in
django.settings.global_settings.py .

Original issue reported on code.google.com by [email protected] on 5 Sep 2008 at 9:13

Nicer URLs for the page parameter

It would be great if there's any way to change the format of the URL.

Maybe some people would prefer /foo/bar/page/42/ to /foo/bar/?page=42.

Original issue reported on code.google.com by [email protected] on 14 Jul 2008 at 8:01

KeyError if the context does not include the request object

What steps will reproduce the problem?
1. Follow steps in the README
2. Render a paginated list on a page which doesn't include the request
object in the context (which is the default case on the Django trunk)
3. Receive a KeyError on line 73 of pagination_tags.py

What version of the product are you using? On what operating system?
I'm on OS X using the Django trunk and the django-pagination trunk.  I can
resolve the problem by including the request object in the context I'm
passing the renderer from my view, like so:

render_to_response('news/index.html', {'request': request, 'stories':
recent_stories})

Please provide any additional information below.
Thanks for providing this code!  Even with the hiccups it's great!

Original issue reported on code.google.com by [email protected] on 17 Jul 2008 at 4:28

'pagination_tags' is not a valid tag library

What steps will reproduce the problem?
1. install pagitation as doc describes
2. add the needed code to template
3. test the page

What is the expected output? What do you see instead?

i see the error: 
Request Method:     GET
Request URL:    http://localhost:8000/cyradm/
Exception Type:     TemplateSyntaxError
Exception Value:    'pagination_tags' is not a valid tag library: Could not
load template library from django.templatetags.pagination_tags, cannot
import name Paginator
Exception Location: 
/usr/lib/python2.4/site-packages/django/template/defaulttags.py in load,
line 750


What version of the product are you using? On what operating system?
linux , python 2.4 , code from svn



Original issue reported on code.google.com by [email protected] on 6 Aug 2008 at 6:22

Google's App Engine Django Template project

What steps will reproduce the problem?
1. Installed GAE
2. Installed appengine_django
3. Copied the pagination folder into my project folder

What is the expected output? What do you see instead?

Exception Value:    'pagination_tags' is not a valid tag library: Could not
load template library from django.templatetags.pagination_tags, cannot
import name Paginator
Exception Location:     C:\Program
Files\Google\google_appengine\lib\django\django\template\defaulttags.py in
load, line 750

What version of the product are you using? On what operating system?

Pagination 1.0.4

Please provide any additional information below.

Should this even work with GAE?

Original issue reported on code.google.com by [email protected] on 11 Nov 2008 at 8:42

TemplateSyntaxError

What steps will reproduce the problem?
1. Add the tag  {% paginate %} after the loop

What is the expected output? What do you see instead?
Expected to output the number of available pages. 
I´ve got an TemplateSyntaxError

What version of the product are you using? On what operating system?
The last one. 
Windows + Python 2.6 + Django 1.1


Please provide any additional information below.

The pagination worked well after put the tag {% paginate %} in the template.

Thanks.

Original issue reported on code.google.com by [email protected] on 19 Jun 2009 at 8:32

Attachments:

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.