Re: where is the error in pagination?

2019-09-25 Thread leb dev

>
> 
>>
>> 
>>
>> {% if object_list.has_previous %}
>>
>>  first
>>
>> previous
>>
>> {% endif %}
>>
>>
>>> 
>>
>> Page {{ object_list.number }} of {{ 
>>> object_list.paginator.num_pages }}.
>>
>> 
>>
>>
>>> {% if object_list.has_next %}
>>
>> next
>>
>> last 
>>
>> {% endif %}
>>
>> 
>>
>> 
>>
>>
On Wednesday, September 25, 2019 at 2:39:16 PM UTC+3, laya Mahmoudi wrote:
>
> Would you send your html codes relating to pagination
>
> در تاریخ چهارشنبه ۲۵ سپتامبر ۲۰۱۹،‏ ۱۵:۰۳ leb dev  
> نوشت:
>
>> i tried your answer and display an error :
>>
>> That page number is not an integer
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0323b126-726e-4889-beee-b68988b1a3f1%40googlegroups.com
>>  
>> 
>> .
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0ad0f775-92f0-4621-b491-5d97a7f9270a%40googlegroups.com.


Re: where is the error in pagination?

2019-09-25 Thread laya Mahmoudi
Would you send your html codes relating to pagination

در تاریخ چهارشنبه ۲۵ سپتامبر ۲۰۱۹،‏ ۱۵:۰۳ leb dev 
نوشت:

> i tried your answer and display an error :
>
> That page number is not an integer
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0323b126-726e-4889-beee-b68988b1a3f1%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABL_bk0%2BFNJzKA%2BbsESdz5g%3D6HODB8LiwxXiJFQ%2BOPnHtw6v1Q%40mail.gmail.com.


Re: where is the error in pagination?

2019-09-25 Thread leb dev
i tried your answer and display an error :

That page number is not an integer

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0323b126-726e-4889-beee-b68988b1a3f1%40googlegroups.com.


RE: where is the error in pagination?

2019-09-25 Thread laya
Try this one :
paginator = Paginator(queryset_list,8)  # Show 25 contacts per page
page_request_var = "page"
page = request.GET.get(page_request_var)
try:
queryset = paginator.page(page)
except PageNotAnInteger:
# If page is not an integer, deliver first page.
queryset = paginator.page(1)
except EmptyPage:
# If page is out of range (e.g. ), deliver last page of results.
queryset = paginator.page(paginator.num_pages)


Sent from Mail for Windows 10

From: leb dev
Sent: Wednesday, September 25, 2019 2:32 PM
To: Django users
Subject: where is the error in pagination?

i have a django project  and it includes pagination i do not know where is the 
error in my code but once i tired to go to the next or previous page it crash 
and display the below error :

> can only concatenate str(not ""NoneType) to str

            query=request.GET.get("search")
            paginator = Paginator(queryset_list, 5) 
            page_request_var = "page"
            print("page_request_var===>",page_request_var)
            page = request.GET.get(page_request_var)
            print("page===>",page)
            queryset = paginator.get_page(page)
            print("queryset===>",queryset)

When i print **page** it display None


 In the browser it suppose to display **page=2=sam**
but instead 
it display **/?=2&20search%20=%20sam**
-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82e3fe0e-e872-4a49-b869-2b67001e3270%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d8b4c32.1c69fb81.58d02.1858%40mx.google.com.


Re: where is the error in pagination?

2019-09-25 Thread leb dev
no i am using function based views

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bf45aef0-f237-43b4-b7fd-49bea6673b36%40googlegroups.com.


RE: where is the error in pagination?

2019-09-25 Thread laya
Hi,
Do you use Class Based View ?


Sent from Mail for Windows 10

From: leb dev
Sent: Wednesday, September 25, 2019 2:32 PM
To: Django users
Subject: where is the error in pagination?

i have a django project  and it includes pagination i do not know where is the 
error in my code but once i tired to go to the next or previous page it crash 
and display the below error :

> can only concatenate str(not ""NoneType) to str

            query=request.GET.get("search")
            paginator = Paginator(queryset_list, 5) 
            page_request_var = "page"
            print("page_request_var===>",page_request_var)
            page = request.GET.get(page_request_var)
            print("page===>",page)
            queryset = paginator.get_page(page)
            print("queryset===>",queryset)

When i print **page** it display None


 In the browser it suppose to display **page=2=sam**
but instead 
it display **/?=2&20search%20=%20sam**
-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82e3fe0e-e872-4a49-b869-2b67001e3270%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d8b498a.1c69fb81.2757b.7648%40mx.google.com.