Re: [Django] #28036: Unexpected exception raised by previous_page_number() method - Django Paginator

2017-04-06 Thread Django
#28036: Unexpected exception raised by previous_page_number() method - Django
Paginator
-+-
 Reporter:  Pat  |Owner:  Pat
 Type:  Uncategorized|   Status:  closed
Component:  Uncategorized|  Version:  1.10
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  paginator,   | Triage Stage:
  InvalidPage|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by kapil garg):

 * status:  assigned => closed
 * resolution:   => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/28036#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.817aee624c5cf0bcc323c66d16826d13%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28036: Unexpected exception raised by previous_page_number() method - Django Paginator

2017-04-06 Thread Django
#28036: Unexpected exception raised by previous_page_number() method - Django
Paginator
-+-
 Reporter:  Pat  |Owner:  Pat
 Type:  Uncategorized|   Status:  assigned
Component:  Uncategorized|  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:  paginator,   | Triage Stage:
  InvalidPage|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by kapil garg):

 because `EmptyPage` is subclass of `InvalidPage`.

 You can catch `EmptyPage` and `PageNotAnInteger` using their super class
 `InvalidPage`

--
Ticket URL: <https://code.djangoproject.com/ticket/28036#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.056658b46a018b79fca87772398e0726%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28036: Unexpected exception raised by previous_page_number() method - Django Paginator

2017-04-06 Thread Django
#28036: Unexpected exception raised by previous_page_number() method - Django
Paginator
-+-
 Reporter:  Pat  |Owner:  Pat
 Type:  Uncategorized|   Status:  assigned
Component:  Uncategorized|  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:  paginator,   | Triage Stage:
  InvalidPage|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Pat):

 * owner:  nobody => Pat
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28036#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.bb659d51610b88a0ca19a25ed7e2d1f5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #28036: Unexpected exception raised by previous_page_number() method - Django Paginator

2017-04-06 Thread Django
#28036: Unexpected exception raised by previous_page_number() method - Django
Paginator
-+-
   Reporter:  Pat|  Owner:  nobody
   Type: | Status:  new
  Uncategorized  |
  Component: |Version:  1.10
  Uncategorized  |   Keywords:  paginator,
   Severity:  Normal |  InvalidPage
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 {{{
 >>> objects = ['john', 'paul', 'george', 'ringo']
 >>> p = Paginator(objects, 2)
 >>> p.count
 4
 >>> p.num_pages
 2
 >>> page1 = p.page(1)
 >>>
 >>> page1.previous_page_number()
 Traceback (most recent call last):
   File "", line 1, in 
   File "C:\Users\Rick\ws2\env\lib\site-packages\django\core\paginator.py",
 line 136
 , in previous_page_number
 return self.paginator.validate_number(self.number - 1)
   File "C:\Users\Rick\ws2\env\lib\site-packages\django\core\paginator.py",
 line 38,
  in validate_number
 raise EmptyPage('That page number is less than 1')
 django.core.paginator.EmptyPage: That page number is less than 1
 >>>
 }}}

 According to the `previous_page_number()` documentation.

 Returns the previous page number. Raises `InvalidPage` if previous page
 doesn’t exist.

 I was expecting `previous_page_number()` to raise `InvalidPage` exception
 as documentation says.

--
Ticket URL: <https://code.djangoproject.com/ticket/28036>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.e0cccd3078f974c33c3e65ef237979a7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.