#5932: Accessing ObjectPaginator.page_range before pages raises TypeError
-----------------------+----------------------------------------------------
Reporter:  anonymous   |       Owner:  nobody        
  Status:  new         |   Component:  Core framework
 Version:  SVN         |    Keywords:                
   Stage:  Unreviewed  |   Has_patch:  0             
-----------------------+----------------------------------------------------
 Example
 {{{
 >>> django.VERSION
 (0, 97, 'pre')
 >>> paginator = ObjectPaginator(prodcats,3)
 >>> paginator.page_range
 Traceback (most recent call last):
   File "<console>", line 1, in <module>
   File "/home2/username/lib/python2.5/django/core/paginator.py", line 94,
 in _get_page_range
     self._page_range = range(1, self._pages + 1)
 TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

 Works if pages is accessed first-

 >>> paginator.pages
 2
 >>> paginator.page_range
 [1, 2]

 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5932>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to