Re: Django Pagination paginate dictionary of objects

2020-07-28 Thread jhabar singh
bro try to send a intended code On Tue, Jul 28, 2020 at 5:16 PM Harvindar Singh Garcha < garchaama...@gmail.com> wrote: > I am new to Django, and trying to paginate a dictionary objects, > However I am unable to so and not getting what's wrong with my code, > Its still printing whole data on a si

Django Pagination paginate dictionary of objects

2020-07-28 Thread Harvindar Singh Garcha
I am new to Django, and trying to paginate a dictionary objects, However I am unable to so and not getting what's wrong with my code, Its still printing whole data on a single page. Above I have posted my View along with template code. class Search(ListView): paginate_by = 5 def get(self, re

Django Pagination paginate dictionary of objects

2020-07-28 Thread Harvindar Singh Garcha
I am new to Django, and trying to paginate a dictionary objects, I am calling stackoverflow API where I want the result to get paginated. However I am unable to so and not getting what's wrong with my code. Above I have posted my View along with template code. > > > class Search(ListView): > p

Re: Django Pagination

2020-06-01 Thread maninder singh Kumar
I think there might be a way around, below is the code modified for views.py @login_required def home_view(request): """Display all the post of friends and own posts on the dashboard""" posts = Post.objects.order_by('-date_posted') media: MEDIA_URL # 'post':Post.objects.filter(Q(author=request.use

Re: Django Pagination

2020-06-01 Thread Akshat Zala
Dear Sir, it shows all the text on all the pages. if there are total 5 posts, then it shows all the 5 posts on all the pages. Thanks, Akshat Zala On Saturday, 30 May 2020 20:54:35 UTC+5:30, maninder singh Kumar wrote: > > Views.py looks fine ! > > regards > willy > > > On Sat, May 30, 2020 at

Re: Django Pagination

2020-05-30 Thread Akshat Zala
Hi, if I change the template to: {% if not is_paginated %} {% if page_obj.has_previous %} First arrow_left {% endif %} {% for num in page_obj.paginator.page_range %} {% if page_obj.number == num %} {{ num }} {% elif num > page_obj.number|add:'-4' and num < page_obj.number|add:'4' %} {{ num }} {%

Re: Django Pagination

2020-05-30 Thread Chetan Ganji
Hi akshat, What is the difficulty? Where have you defined the variable is_paginated? Is it present in the context? On Sat, May 30, 2020, 8:53 PM maninder singh Kumar < maninder.s.ku...@gmail.com> wrote: > Views.py looks fine ! > > regards > willy > > > On Sat, May 30, 2020 at 7:22 PM Akshat Zal

Re: Django Pagination

2020-05-30 Thread maninder singh Kumar
Views.py looks fine ! regards willy On Sat, May 30, 2020 at 7:22 PM Akshat Zala wrote: > Hello, > > I am finding it difficult to paginate through all the posts > > My views.py : > > @login_required > def home_view(request): > """Display all the post of friends and own posts on the dashboard"""

Re: Django Pagination

2020-05-30 Thread Akshat Zala
On Saturday, 30 May 2020 19:20:47 UTC+5:30, Akshat Zala wrote: > > Hello, > > I am finding it difficult to paginate through all the posts > > My views.py : > > @login_required > def home_view(request): > """Display all the post of friends and own posts on the dashboard""" > posts = Post.objects.

Django Pagination

2020-05-30 Thread Akshat Zala
Hello, I am finding it difficult to paginate through all the posts My views.py : @login_required def home_view(request): """Display all the post of friends and own posts on the dashboard""" posts = Post.objects.all().order_by('-date_posted') media: MEDIA_URL # 'post':Post.objects.filter(Q(author

Re: how to use django pagination with sql query and not ORM

2019-09-24 Thread Deep Sukhwani
_staff`, `auth_user`.`is_active`, `auth_user`.`date_joined` FROM `auth_user` WHERE `auth_user`.`username` LIKE BINARY %alpha% 1: https://docs.djangoproject.com/en/2.2/topics/db/sql/#performing-raw-queries -- Regards Deep L Sukhwani On Wed, 25 Sep 2019 at 00:47, leb dev wrote: > I now how

how to use django pagination with sql query and not ORM

2019-09-24 Thread leb dev
I now how to use django pagination with ORM django after filtering the required data and put in into *pagination div* *queryset_list = employee.objects.all()* *query=request.GET.get("q")* *if query:* *queryset_list=queryset_list.filter(* * Q(name__icont

Re: Using django pagination or slicing

2016-10-31 Thread ADEWALE ADISA
er >> scroll the browser another batches will be append to the browser. >> Below are the 3 ways am aiming to achieve this: >> >> 1. Using django pagination feature. >> >> 2. Everytime records need to be appended to the browser , an ajax call is >> made to the view, t

Re: Using django pagination or slicing

2016-10-31 Thread ADEWALE ADISA
can take minutes. I have experienced that issue with two different > project. > > Django pagination by itself won't give you the infinite scroll you are > expecting. But it should give you an easy interface for slicing the > data from your db. > > An easier way might be

Re: Using django pagination or slicing

2016-10-31 Thread 王安刚
following > issues. > I have a database table consist of about 1000 record. I need to be > displaying like 20 records at a time on a page such that when the user > scroll the browser another batches will be append to the browser. > Below are the 3 ways am aiming to achieve t

Re: Using django pagination or slicing

2016-10-31 Thread ludovic coues
I would use 1 + 2 from your list. 3 might work on 1000 record, depending on how much data there is per record. But if you grow to more than 10,000 record, the page loading can take minutes. I have experienced that issue with two different project. Django pagination by itself won't give yo

Using django pagination or slicing

2016-10-30 Thread ADEWALE ADISA
the 3 ways am aiming to achieve this: 1. Using django pagination feature. 2. Everytime records need to be appended to the browser , an ajax call is made to the view, then the queryset is slice using appropriate lower and upper band. Then the returned record is appended to the browser. 3. Fetch

Re: django pagination

2016-01-26 Thread Xristos Xristoou
d think how to > refactor it > if you want only paginate posts, i'll recommend you to use > django-pagination app of some sort, it's can be used in template > > On Monday, January 25, 2016 at 5:16:31 PM UTC+3, Xristos Xristoou wrote: >> >> i want to using Pag

Re: django pagination

2016-01-26 Thread Xristos Xristoou
i foolow the steps but i have again error my new view : def index(request): try: page = request.GET.get('page', 1), except PageNotAnInteger: page = 1, objects = ['john', 'edward', 'josh', 'frank'] p = Paginator(objects,request=request) people = p.page(page)

Re: django pagination

2016-01-26 Thread Xristos Xristoou
that method is Confusing,i try to understand,i create new view or i work with current?i not understand it the using 'people' and object on they view Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > i want to using Paginator in my main page for my post l

Re: django pagination

2016-01-26 Thread pa xapy
are you using python 3? that's actually what i talking about - it's too old try another one, like this https://github.com/jamespacileo/django-pure-pagination - follow the instructions and i hope you'll be fine On Tuesday, January 26, 2016 at 5:09:29 PM UTC+3, Xristos Xristoou wrote: > > i follow

Re: django pagination

2016-01-26 Thread Xristos Xristoou
i follow the simpe steps but i take error invalid syntax (pagination_tags.py, line 225) Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > i want to using Paginator in my main page for my post list. i see docs and > examples for that but i thing my probl

Re: django pagination

2016-01-26 Thread Xristos Xristoou
thnx you i try to use that now Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > i want to using Paginator in my main page for my post list. i see docs and > examples for that but i thing my problem is a specific, because on my view > i have two Querys

Re: django pagination

2016-01-26 Thread pa xapy
s for package you choose but i'm afraid that this particular app is too old and you can experience some troubles with it anyways, you can try: pip install django-pagination On Tuesday, January 26, 2016 at 4:44:05 PM UTC+3, Xristos Xristoou wrote: > > one more question how to install this

Re: django pagination

2016-01-26 Thread Xristos Xristoou
one more question how to install this ?autopagination ?i dont see anything Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > i want to using Paginator in my main page for my post list. i see docs and > examples for that but i thing my problem is a specif

Re: django pagination

2016-01-26 Thread pa xapy
you can read the usage doc i sent linked, but yes - you don't need to do anything with you queryset in view only pass it to template On Tuesday, January 26, 2016 at 4:39:17 PM UTC+3, Xristos Xristoou wrote: > > if i use {autopagination} i dont need quyre on my view ? > > Τη Δευτέρα, 25 Ιανουαρίου

Re: django pagination

2016-01-26 Thread Xristos Xristoou
if i use {autopagination} i dont need quyre on my view ? Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > i want to using Paginator in my main page for my post list. i see docs and > examples for that but i thing my problem is a specific, because on my

Re: django pagination

2016-01-26 Thread pa xapy
if you'll decide to use some app for pagination, you can do it in template, like so https://github.com/ericflo/django-pagination/blob/master/docs/usage.txt ({% autopaginate posts 10 %}) or you can choose one of these https://www.djangopackages.com/grids/g/pagination/ there is no actual ne

Re: django pagination

2016-01-26 Thread Xristos Xristoou
can you show me one examples with my view ? Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > i want to using Paginator in my main page for my post list. i see docs and > examples for that but i thing my problem is a specific, because on my view > i hav

Re: django pagination

2016-01-26 Thread pa xapy
you want to paginate both querysets at the same page? i believe it's a pretty strange idea and if so, you should think how to refactor it if you want only paginate posts, i'll recommend you to use django-pagination app of some sort, it's can be used in template On Monday, Januar

django pagination

2016-01-25 Thread Xristos Xristoou
i want to using Paginator in my main page for my post list. i see docs and examples for that but i thing my problem is a specific, because on my view i have two Querys not one. def index(request): return render_to_response("blog/posts_list.html", { 'categories': Category.objects.all

Re: Django Pagination

2013-10-03 Thread Hélio Miranda
Thanks for the help guys, I managed to solve, so I did: * queryset = Player.objects.filter(name=namepost)* *paginator = Paginator(queryset, 2)* * * *try: * * page = int(request.POST.get('page','1')) * *except ValueError: * * page = 1 * *try:

Re: Django Pagination

2013-10-03 Thread Hélio Miranda
thus still giving the same error -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: Django Pagination

2013-10-03 Thread Roberto López López
On 10/03/2013 04:13 PM, Roberto López López wrote: > *return HttpResponse(json.dumps([players]) , > content_type='application/json')* better without the square brackets *return HttpResponse(json.dumps(players) , content_type='application/json')* -- Roberto López López System Developer Paral

Re: Django Pagination

2013-10-03 Thread Hélio Miranda
doing so: *queryset = Player.objects.filter(name=namepost)* *paginator = Paginator(queryset, 2)* * * *page = request.GET.get('page')* *try:* *players = paginator.page(page)* *except PageNotAnInteger:* *players = paginator.page(1)* *exc

Re: Django Pagination

2013-10-03 Thread Roberto López López
Try this (I have not tried the code myself, but I think that it should work): *queryset = Player.objects.filter(name=namepost)* *paginator = Paginator(queryset, 2) page = request.GET.get('page') try: players = paginator.page(page) except PageNotA

Re: Django Pagination

2013-10-03 Thread Roberto López López
Better to say: *queryset = Player.objects.filter(name=namepost)* *paginator = Paginator(queryset, 2) page = request.GET.get('page') try: players = paginator.page(page) except PageNotAnInteger: players = paginator.page(1) excep

Re: Django Pagination

2013-10-03 Thread Hélio Miranda
Already got it, I did so: *queryset = Player.objects.filter(name=namepost)* *paginator = Paginator(queryset, 2)* *return HttpResponse(json.dumps([item.get_json() for item in paginator.object_list]) , content_type='application/json')* But I return all the records ... I should not retur

Re: Django Pagination

2013-10-03 Thread Hélio Miranda
Already got it, I did so: *queryset = Player.objects.filter(name=namepost)* *paginator = Paginator(queryset, 1)* *return HttpResponse(json.dumps([item.get_json() for item in paginator.object_list]) , content_type='application/json')* But I return all the records ... I should not retur

Re: Django Pagination

2013-10-03 Thread Hélio Miranda
I'm doing this: *queryset = Player.objects.filter(name=namepost)* *paginator = Paginator(queryset, 20)* *return json.dumps([item.get_json() for item in paginator.object_list])* And my Document is thus: http://plnkr.co/edit/FHH2hZh26OiLMKTk2ToO But it gives me the following error: 'st

Re: Django Pagination

2013-10-03 Thread Tom Christie
Hi Hélio, It looks like you're applying pagination to the rendered JSON string itself. You want to be paginating the queryset itself. queryset = Player.objects.filter(name=namepost) paginator = Paginator(queryset, 20) return json.dumps([item.to_dict() for item in paginator.object_list

Django Pagination

2013-10-03 Thread Hélio Miranda
Hi guys. I'm here with a problem that does not quite know how to solve. I have this query: result = json.dumps([a.get_json() for a in Player.objects.filter(name=namepost)]) But now I want to return the result with paging, and do not really know how to do ... I've been seeing in the documentatio

Re: Django Pagination Not Working!

2012-05-08 Thread Tom Evans
On Sun, May 6, 2012 at 10:56 PM, coded kid wrote: > I'm trying to paginate a page in order to display five statuses per > page. After inputting these codes, it fails to paginate. Below are the > codes for pagination and updating of status in my django app. > > > Views: > >  def qask(request): >  

Django Pagination Not Working!

2012-05-06 Thread coded kid
I'm trying to paginate a page in order to display five statuses per page. After inputting these codes, it fails to paginate. Below are the codes for pagination and updating of status in my django app. Views: def qask(request): extra_data_context={} #if there's nothing in

Django - pagination - split articles manually?

2011-10-22 Thread Petey
Is it possible to split articles manually with some sort of a pagination tag in the text? Whole text: Part 1: Lorem ipsum dolor sit amet, consectetur adipiscing elit. {{ split_tag.page1 }} Part 2: Vivamus sit amet odio a turpis congue tincidunt. {{ split_tag.page2 }} etc. -- You received thi

Re: Django pagination is repeating results

2011-02-24 Thread diogobaeder
Nevermind, it is a SQL Server problem. (I hate SQL Server. There, I said it.) I had to first filter manually by the m2m objects, then apply the pagination to the results. Thanks! On Feb 18, 2:53 pm, David De La Harpe Golden wrote: > On 18/02/11 17:38,diogobaederwrote: > > > Hi, > > Any ideas of

Re: Django pagination is repeating results

2011-02-18 Thread David De La Harpe Golden
On 18/02/11 17:38, diogobaeder wrote: > Hi, > Any ideas of what might be happening? > Have you set a Meta.ordering on your Model (or applied an .order_by() to the QuerySet?) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Django pagination is repeating results

2011-02-18 Thread diogobaeder
Hi, I have this weird pagination bug in Django: using object_list as a return of a view, but passing a "paginate_by" argument to it, it's repeating some of the results; Otherwise, if I remove the argument or set as "paginate_by=None", the results are correct. If using pagination, the quantity of

Re: django pagination

2010-08-06 Thread kostia
I don't have time to watch your code, but... Take a look here http://www.tummy.com/Community/Articles/django-pagination/ I set up this cool pagination in 15 minutes without errors! -- You received this message because you are subscribed to the Google Groups "Django users" gr

django pagination

2010-08-06 Thread bulya911
I can't find a mistake :-(( {{ autopaginate product 2 }} is working, because of only two products I see, but {{ paginate }} is NOT, its returns just nothing Here my template: {% load i18n %} {% load pagination_tags %} {% autopaginate product 2 %} Delete All | Another Action {

Re: One to many django pagination

2010-06-22 Thread jx jx
22, 3:39 am, Jx wrote: > > Hi, > > > > i recently encountered a problem due to inefficient performance of > > django pagination. After researching, i realized that there is a need > > to use django database queries when dealing with django-pagination as > > &q

Re: One to many django pagination

2010-06-22 Thread euan.godd...@googlemail.com
hips). Then you should be able to do: teachers = Teacher.objects.filter(student__name="Jonny") I think the ORM should take care of this query for you and select only those teachers. Euan On Jun 22, 3:39 am, Jx wrote: > Hi, > > i recently encountered a problem due to inefficie

One to many django pagination

2010-06-21 Thread Jx
Hi, i recently encountered a problem due to inefficient performance of django pagination. After researching, i realized that there is a need to use django database queries when dealing with django-pagination as "LIMIT" will automatically be added. This is useful especially when dealing

Re: question about django-pagination

2009-12-19 Thread Rodrigo Cea
You can paginate whatever you want. From the docs: "Note that you can give Paginator a list/tuple, a Django QuerySet, or any other object with a count() or __len__() method. " On Dec 19, 3:33 am, Continuation wrote: > In the django-pagination, it uses the example: > {% autopagi

Re: question about django-pagination

2009-12-18 Thread Lakshman Prasad
> would I still be able to paginate over the entire list of 1 objects? Or my list would be shortened to 5 objects? Its the latter. Your query set will loop only for the size of it's length. On Sat, Dec 19, 2009 at 12:03 PM, Continuation wrote: > In the django-pagination,

question about django-pagination

2009-12-18 Thread Continuation
In the django-pagination, it uses the example: {% autopaginate object_list %} My question is does object_list have to be the **entire** list over which I want to paginate, or can I limit the length of object_list? If I limit the length of object_list, will autopaginate still go through the entire

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-21 Thread tezro
gt; > On Aug 30, 2:47 pm, tezro wrote: > > > > > > > Anyone? > > > > > > > On Aug 14, 8:29 am, tezro wrote: > > > > > > > > The question is that > > > > "django.views.generic.date_based.

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-19 Thread Михаил Лукин
> The question is that > > > "django.views.generic.date_based.archive_index()" > > > > > > takes an optional argument "num_latest" which is 15 by default. > > > > > > Setting it manually to num_latest=10 is way off to >

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-19 Thread tezro
tezro wrote: > > > > > > The question is that > > "django.views.generic.date_based.archive_index()" > > > > > takes an optional argument "num_latest" which is 15 by default. > > > > > Setting it manually to num_l

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread Михаил Лукин
yone? > > > > > On Aug 14, 8:29 am, tezro wrote: > > > > > > The question is that > "django.views.generic.date_based.archive_index()" > > > > takes an optional argument "num_latest" which is 15 by default. > > > &g

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread tezro
ent "num_latest" which is 15 by default. > > > Setting it manually to num_latest=10 is way off to correct to > > > me. It works. I suppose that it even doesn't retrieve all the tons of > > > data from the DB, but what if I have 10 + 1 record :)

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread Mihail Lukin
It works. I suppose that it even doesn't retrieve all the tons of > > data from the DB, but what if I have 10 + 1 record :) > > > What's the right way to use "django-pagination" and the "archive_index > > ()" or am I missing something?

Re: django pagination

2009-09-05 Thread Karen Tracey
On Sat, Sep 5, 2009 at 4:52 PM, Michael Ralan wrote: > > Hi, > > Apologies if this question has been asked before but I was not able to > find a satisfactory answer. > > In the django admin app there is a capability to have a pagination > object that lists the number of pages that can be paged. >

django pagination

2009-09-05 Thread Michael Ralan
Hi, Apologies if this question has been asked before but I was not able to find a satisfactory answer. In the django admin app there is a capability to have a pagination object that lists the number of pages that can be paged. I have found code that uses the django Paginator object which builds

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-08-30 Thread tezro
It works. I suppose that it even doesn't retrieve all the tons of > data from the DB, but what if I have 10 + 1 record :) > > What's the right way to use "django-pagination" and the "archive_index > ()" or am I missing something? > > Example co

"django-pagination" and generic.views.date_based.archive_index()

2009-08-13 Thread tezro
of data from the DB, but what if I have 10 + 1 record :) What's the right way to use "django-pagination" and the "archive_index ()" or am I missing something? Example code. ___ def index(request): qs = News.objects.filter(is_published=

django-pagination with search form

2009-08-06 Thread Streamweaver
Simple Pagination in Django is great but I'm having some trouble with the best way to design pagination with querysets derived from Search Forms. I'm currently using the Django-Pagination middleware and it works great but there's really pretty bad documentation on it (as with man