Re: Pagination with Custom Views

2006-11-18 Thread [EMAIL PROTECTED]
That was supposed to go into a separate topic.. sorry! --~--~-~--~~~---~--~~ 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 th

Pagination with Custom Views

2006-11-18 Thread [EMAIL PROTECTED]
Hey Everyone, I have a custon view set up which is basically a list of all the posts within a category, which is paginated. Here is the code which I have got working so far: def category_detail(request, slug): recent_posts = Post.objects.order_by('-pub_date')[:10] category = sho

Re: Pagination with Custom Views

2006-11-17 Thread soundseeker
holy ... , how stupid. but it led not to the solution, which is: TMergeDoc().by_categories() I had to instantiate the object, of course. Now there are some paginator problems I have to analyze. thank you very much so far! robert --~--~-~--~~~---~--~~ You rece

Re: Re: Pagination with Custom Views

2006-11-16 Thread James Bennett
On 11/16/06, soundseeker <[EMAIL PROTECTED]> wrote: > I'm desperately searching for a solution as described here (paginator + > costom sql): In the example you've posted, the method name is 'by_categories', but you seem to be using 'by_category' to execute it. A method named 'by_categories' will

Re: Pagination with Custom Views

2006-11-16 Thread soundseeker
hello, I'm desperately searching for a solution as described here (paginator + costom sql): http://groups.google.com/group/django-users/browse_frm/thread/1aa04d3ab8fc9203/ab1384a82c9d5508#ab1384a82c9d5508 and here: http://groups.google.com/group/django-users/browse_frm/thread/d6690c92c5b7347e/7985

Re: Pagination with Custom Views

2006-11-16 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > Specifically: > > unsupported operand type(s) for -: 'str' an Oh... I've forgot to cast a string to an int :-). The line: int(request.GET.get('page', '1')) In fact you should also check for errors here because user can submit something with "page=blah" and it w

Re: Pagination with Custom Views

2006-11-16 Thread [EMAIL PROTECTED]
Sorry, I meant: unsupported operand type(s) for -: 'str' and 'int' [EMAIL PROTECTED] wrote: > Specifically: > > unsupported operand type(s) for -: 'str' an --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Pagination with Custom Views

2006-11-16 Thread [EMAIL PROTECTED]
Ivan: Thanks so much for your quick reply. One more question - how would I define the page in the URL... ?page=x throws errors at me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Pagination with Custom Views

2006-11-16 Thread [EMAIL PROTECTED]
Specifically: unsupported operand type(s) for -: 'str' an --~--~-~--~~~---~--~~ 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 fro

Re: Pagination with Custom Views

2006-11-16 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > Hey, > > I was just wondering if someone could help me out. I want to paginate > some views, but they are not generic. This is one of the views I want > to paginate: > > def category_list(request): > categories = Category.objects.order_by('name') > > retur

Pagination with Custom Views

2006-11-16 Thread [EMAIL PROTECTED]
Hey, I was just wondering if someone could help me out. I want to paginate some views, but they are not generic. This is one of the views I want to paginate: def category_list(request): categories = Category.objects.order_by('name') return shortcuts.render_to_response("blog/cate