Re: digg style pagination
Agree. Fixed now On Thu, Nov 19, 2009 at 11:51 AM, Tim Chase wrote: >> But getting an exception. Could you help to fix it please? >> >> TemplateSyntaxError at /section/home >> >> Caught an exception while rendering: 'request' >> >> Original Traceback (most recent call last): >> File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", >> line 71, in render_node >> result = node.render(context) >> File >> "/opt/local/lib/python2.5/site-packages/django_pagination-1.0.5-py2.5.egg/pagination/templatetags/pagination_tags.py", >> line 90, in render >> page_obj = paginator.page(context['request'].page) >> File "/opt/local/lib/python2.5/site-packages/django/template/context.py", >> line 49, in __getitem__ >> raise KeyError(key) >> KeyError: 'request' > > Sounds exactly like the error suggests: you haven't included the > request in your rendering context. What is your view for > rendering this template? Does it pass a RequestContext to > render_to_response or does it just pass a dictionary without > > 'request': request, > > in it? > > -tim > > > -- > > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=. > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=.
Re: digg style pagination
> But getting an exception. Could you help to fix it please? > > TemplateSyntaxError at /section/home > > Caught an exception while rendering: 'request' > > Original Traceback (most recent call last): > File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", > line 71, in render_node > result = node.render(context) > File > "/opt/local/lib/python2.5/site-packages/django_pagination-1.0.5-py2.5.egg/pagination/templatetags/pagination_tags.py", > line 90, in render > page_obj = paginator.page(context['request'].page) > File "/opt/local/lib/python2.5/site-packages/django/template/context.py", > line 49, in __getitem__ > raise KeyError(key) > KeyError: 'request' Sounds exactly like the error suggests: you haven't included the request in your rendering context. What is your view for rendering this template? Does it pass a RequestContext to render_to_response or does it just pass a dictionary without 'request': request, in it? -tim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=.
Re: digg style pagination
I am trying to use the application http://code.google.com/p/django-pagination/, that you proposed in the latest post. But getting an exception. Could you help to fix it please? TemplateSyntaxError at /section/home Caught an exception while rendering: 'request' Original Traceback (most recent call last): File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 71, in render_node result = node.render(context) File "/opt/local/lib/python2.5/site-packages/django_pagination-1.0.5-py2.5.egg/pagination/templatetags/pagination_tags.py", line 90, in render page_obj = paginator.page(context['request'].page) File "/opt/local/lib/python2.5/site-packages/django/template/context.py", line 49, in __getitem__ raise KeyError(key) KeyError: 'request' Request Method: GET Request URL: http://127.0.0.1:8000/section/home Exception Type: TemplateSyntaxError Exception Value: Caught an exception while rendering: 'request' Original Traceback (most recent call last): File "/opt/local/lib/python2.5/site-packages/django/template/debug.py", line 71, in render_node result = node.render(context) File "/opt/local/lib/python2.5/site-packages/django_pagination-1.0.5-py2.5.egg/pagination/templatetags/pagination_tags.py", line 90, in render page_obj = paginator.page(context['request'].page) File "/opt/local/lib/python2.5/site-packages/django/template/context.py", line 49, in __getitem__ raise KeyError(key) KeyError: 'request' On Mon, Sep 7, 2009 at 7:38 PM, Michael Ralan wrote: > > It's possible to get digg-style pagination yes. What you need to do is > this. > > Get the django-pagination add-on from the following url > > http://code.google.com/p/django-pagination/ > > The documentation says unzip the pagination folder to a path > accessible to python. This is usually taken to mean your site-packages > folder. I couldn't do that because my app will be hosted on a server > where I don't have that sort privilege. > > So what I did was to unzip it into a folder I did have access to. > Because I'm running django using mod_wsgi there is a place I could add > the following line to my initialization code. (Actually I added it to > my projectfolder\apache\django.wsgi file). Unless the latter is > already familiar to you probably have to scratch around somewhere. > > sys.path.append('g:/xampp/htdocs/pagination') > > From this point I followed the included documentation and it works! > > For the digg-look and feel I had to download some .css styling at > > > http://mis-algoritmos.com/2007/03/16/some-styles-for-your-pagination/?page=2 > > Hope this helps! > > Regards > > On Aug 17, 3:19 pm, sniper wrote: > > Hi, > > Thanks for the help. I thought there would be django's official built > > in > > functionality which i might have missed, but looks like i have to > > use unofficial third party code. > > > > On Aug 14, 6:49 pm, Benjamin Wohlwend wrote: > > > > > Hi, > > > > > On Aug 14, 8:54 pm,sniper wrote: > > > > > > I am asking this because in the admin page, the list page uses digg > > > > style paging. > > > > > Like everything else that comes with Django, the admin app is open > > > source, so nothing stops you from having a peek. This particular > > > functionality can be found in django/contrib/admin/templatetags/ > > > admin_list.py, line 28[1]. The template tag has some admin-specifics > > > in it, you'd have to copy the template tag and adjust it. Or, and this > > > is probably what David so eloquently suggested, you could use one of > > > the countless digg-style paginators for Django that float around the > > > net. I'm quite fond of this[2] one because it extends the built-in > > > pagination facilities instead of completely reinventing the wheel. > > > > > Kind regards, > > > Benjamin > > > > > [1] > http://code.djangoproject.com/browser/django/trunk/django/contrib/adm... > > > [2]http://www.djangosnippets.org/snippets/773/ > --~--~-~--~~~---~--~~ > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en > -~--~~~~--~~--~--~--- > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=.
Re: digg style pagination
It's possible to get digg-style pagination yes. What you need to do is this. Get the django-pagination add-on from the following url http://code.google.com/p/django-pagination/ The documentation says unzip the pagination folder to a path accessible to python. This is usually taken to mean your site-packages folder. I couldn't do that because my app will be hosted on a server where I don't have that sort privilege. So what I did was to unzip it into a folder I did have access to. Because I'm running django using mod_wsgi there is a place I could add the following line to my initialization code. (Actually I added it to my projectfolder\apache\django.wsgi file). Unless the latter is already familiar to you probably have to scratch around somewhere. sys.path.append('g:/xampp/htdocs/pagination') >From this point I followed the included documentation and it works! For the digg-look and feel I had to download some .css styling at http://mis-algoritmos.com/2007/03/16/some-styles-for-your-pagination/?page=2 Hope this helps! Regards On Aug 17, 3:19 pm, sniper wrote: > Hi, > Thanks for the help. I thought there would be django's official built > in > functionality which i might have missed, but looks like i have to > use unofficial third party code. > > On Aug 14, 6:49 pm, Benjamin Wohlwend wrote: > > > Hi, > > > On Aug 14, 8:54 pm,sniper wrote: > > > > I am asking this because in the admin page, the list page uses digg > > > style paging. > > > Like everything else that comes with Django, the admin app is open > > source, so nothing stops you from having a peek. This particular > > functionality can be found in django/contrib/admin/templatetags/ > > admin_list.py, line 28[1]. The template tag has some admin-specifics > > in it, you'd have to copy the template tag and adjust it. Or, and this > > is probably what David so eloquently suggested, you could use one of > > the countless digg-style paginators for Django that float around the > > net. I'm quite fond of this[2] one because it extends the built-in > > pagination facilities instead of completely reinventing the wheel. > > > Kind regards, > > Benjamin > > > [1]http://code.djangoproject.com/browser/django/trunk/django/contrib/adm... > > [2]http://www.djangosnippets.org/snippets/773/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: digg style pagination
Hi, Thanks for the help. I thought there would be django's official built in functionality which i might have missed, but looks like i have to use unofficial third party code. On Aug 14, 6:49 pm, Benjamin Wohlwend wrote: > Hi, > > On Aug 14, 8:54 pm,sniper wrote: > > > I am asking this because in the admin page, the list page uses digg > > style paging. > > Like everything else that comes with Django, the admin app is open > source, so nothing stops you from having a peek. This particular > functionality can be found in django/contrib/admin/templatetags/ > admin_list.py, line 28[1]. The template tag has some admin-specifics > in it, you'd have to copy the template tag and adjust it. Or, and this > is probably what David so eloquently suggested, you could use one of > the countless digg-style paginators for Django that float around the > net. I'm quite fond of this[2] one because it extends the built-in > pagination facilities instead of completely reinventing the wheel. > > Kind regards, > Benjamin > > [1]http://code.djangoproject.com/browser/django/trunk/django/contrib/adm... > [2]http://www.djangosnippets.org/snippets/773/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: digg style pagination
Hi, On Aug 14, 8:54 pm, sniper wrote: > I am asking this because in the admin page, the list page uses digg > style paging. Like everything else that comes with Django, the admin app is open source, so nothing stops you from having a peek. This particular functionality can be found in django/contrib/admin/templatetags/ admin_list.py, line 28[1]. The template tag has some admin-specifics in it, you'd have to copy the template tag and adjust it. Or, and this is probably what David so eloquently suggested, you could use one of the countless digg-style paginators for Django that float around the net. I'm quite fond of this[2] one because it extends the built-in pagination facilities instead of completely reinventing the wheel. Kind regards, Benjamin [1] http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templatetags/admin_list.py#L28 [2] http://www.djangosnippets.org/snippets/773/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: digg style pagination
You didn't understand my question... i am asking if there is a django's built in functionality. Google shows people making custom ones or extending paginator. On Aug 14, 3:00 pm, David Zhou wrote: > http://tinyurl.com/mj29fw > > -- dz > > > > On Fri, Aug 14, 2009 at 2:54 PM, sniper wrote: > > > I am trying to do pagination. Just wanted to know if there is a > > shortcut to show digg style pagination or i have to write my own? > > I am asking this because in the admin page, the list page uses digg > > style paging. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: digg style pagination
http://tinyurl.com/mj29fw -- dz On Fri, Aug 14, 2009 at 2:54 PM, sniper wrote: > > I am trying to do pagination. Just wanted to know if there is a > shortcut to show digg style pagination or i have to write my own? > I am asking this because in the admin page, the list page uses digg > style paging. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---