Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2012-06-09 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
-+-
 Reporter:  mehta.apurva@…   |Owner:  neaf
 Type:  New feature  |   Status:  closed
Component:  Core (Other) |  Version:  1.3
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  paginator core   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  1|  Needs documentation:  1
Easy pickings:  1|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by Claude Paroz ):

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


Comment:

 In [fc40a6504b78e604a6ba90a3b85b1ed54ee238a2]:
 {{{
 #!CommitTicketReference repository=""
 revision="fc40a6504b78e604a6ba90a3b85b1ed54ee238a2"
 Fixed #17159 -- Validated returned number of next|previous_page_number

 Thanks mehta.apurva at gmail.com for the report and the initial patch
 and neaf for the complete patch.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2012-02-11 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
-+-
 Reporter:  mehta.apurva@…   |Owner:  neaf
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  paginator core   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  1|  Needs documentation:  1
Easy pickings:  1|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by julien):

 Quick note: This is slightly backward-compatible and some release notes
 should be added.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2012-02-04 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
-+-
 Reporter:  mehta.apurva@…   |Owner:  neaf
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  paginator core   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  1|  Needs documentation:  1
Easy pickings:  1|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by jezdez):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2012-02-04 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+
 Reporter:  mehta.apurva@…  |Owner:  neaf
 Type:  New feature |   Status:  assigned
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  paginator core  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  1
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by neaf):

 * status:  new => assigned


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2012-02-04 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+
 Reporter:  mehta.apurva@…  |Owner:  neaf
 Type:  New feature |   Status:  new
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  paginator core  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  1
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by neaf):

 Attached another patch with tests and documentation.

 I'm not sure if it isn't compatibility breaking change. I'm pretty sure
 no-one wants to display 0 and out-of-range pages but I don't know if we
 should throw exceptions where we haven't in the ast.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2011-11-07 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+--
 Reporter:  mehta.apurva@…  |Owner:  mehta.apurva@…
 Type:  New feature |   Status:  reopened
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  paginator core  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  1
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by julien):

 * needs_docs:  0 => 1
 * needs_tests:  0 => 1


Comment:

 Thank you. This would now need some tests and documentation
 (https://docs.djangoproject.com/en/dev/topics/pagination/).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2011-11-07 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+--
 Reporter:  mehta.apurva@…  |Owner:  mehta.apurva@…
 Type:  New feature |   Status:  reopened
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  paginator core  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by aaugustin):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Please don't mark tickets as fixed until the fix is actually committed to
 the code base.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2011-11-07 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+--
 Reporter:  mehta.apurva@…  |Owner:  mehta.apurva@…
 Type:  New feature |   Status:  closed
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:  fixed
 Keywords:  paginator core  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by amehta):

 * status:  new => closed
 * has_patch:  0 => 1
 * resolution:   => fixed


Comment:

 Updated the functions to call Page.paginator.validate_number()

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2011-11-06 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+--
 Reporter:  mehta.apurva@…  |Owner:  mehta.apurva@…
 Type:  New feature |   Status:  new
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  paginator core  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by julien):

 * type:  Bug => New feature


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2011-11-06 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+--
 Reporter:  mehta.apurva@…  |Owner:  mehta.apurva@…
 Type:  Bug |   Status:  new
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  paginator core  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by julien):

 * stage:  Unreviewed => Accepted


Old description:

> The next_page_number() and previous_page_number() currently return an
> incremented or decremented number without verifying if the page is in the
> range or not. They should instead throw an exception.
>
> Repro Steps
> ===
> >>> from django.core.paginator import Paginator
> >>> objects = ['john', 'paul', 'george', 'ringo', 'bill', 'gates',
> 'steve', 'jobs']
> >>> p = Paginator(objects, 2)
> >>> p.count
> 8
> >>> p.num_pages
> 4
> >>> p.page_range
> [1, 2, 3, 4]
> >>> p.page(1).has_previous()
> False
> >>> p.page(4).has_next()
> False
> >>> p.page(1).previous_page_number()  ### Should throw Exception
> 0
> >>> p.page(4).next_page_number() ### Should throw Exception
> 5
> >>>

New description:

 The next_page_number() and previous_page_number() currently return an
 incremented or decremented number without verifying if the page is in the
 range or not. They should instead throw an exception.

 Repro Steps
 ===
 {{{#!python
 >>> from django.core.paginator import Paginator
 >>> objects = ['john', 'paul', 'george', 'ringo', 'bill', 'gates',
 'steve', 'jobs']
 >>> p = Paginator(objects, 2)
 >>> p.count
 8
 >>> p.num_pages
 4
 >>> p.page_range
 [1, 2, 3, 4]
 >>> p.page(1).has_previous()
 False
 >>> p.page(4).has_next()
 False
 >>> p.page(1).previous_page_number()  ### Should throw Exception
 0
 >>> p.page(4).next_page_number() ### Should throw Exception
 5
 }}}

--

Comment:

 That makes sense. It would be a matter of calling
 `Page.paginator.validate_number()`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17159: Paginator.Page() should throw an exception for invalid [next|previous]_page_number()

2011-11-03 Thread Django
#17159: Paginator.Page() should throw an exception for invalid
[next|previous]_page_number()
+--
 Reporter:  mehta.apurva@…  |Owner:  mehta.apurva@…
 Type:  Bug |   Status:  new
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  paginator core  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by anonymous):

 * owner:  nobody => mehta.apurva@…
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.