Commit Graph

17 Commits

Author SHA1 Message Date
Gary Wilson Jr 351a3ca154 Removed several deprecated features for 1.0 (refs #7830):
* "simple" cache backend
 * `ObjectPaginator`
 * `edit_inline_type` argument for `ForeignKey` fields
 * `QOperator`, `QNot`, `QAnd` and `QOr`
 * `maxlength` argument 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02 04:56:11 +00:00
Gary Wilson Jr 96cf3656c4 Fixed #6997 -- Corrected `num_pages` calculation when one item is in the object list and `allow_empty_first_page=False`, thanks to framos for the report. Also, made Page's `start_index()` return 0 if there are no items in the object list (previously it was returning 1, but now it is consistent with `end_index()`). As an added bonus, I threw in quite a few pagination tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28 05:30:35 +00:00
Gary Wilson Jr 9a5301ccbc Made the Paginator class a bit more backwards compatible with the lecacy `ObjectPaginator` class by using the `ObjectPaginator`'s `_get_count` method. Instead of explicitly checking for an instance of `QuerySet`, this now allows any object with a `count()` or `__len__()` method defined to be passed to Paginator. For one, this is useful when you have custom `QuerySet`-like classes that implement a `count()` method but don't inherit from `QuerySet` explicitly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 23:01:55 +00:00
Adrian Holovaty a724fff300 Fixed #7307 -- Split InvalidPage exception into two subclasses, PageNotAnInteger and EmptyPage, for granular exception catching. Thanks for the idea, miracle2k
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 02:20:48 +00:00
Adrian Holovaty 4406d283e1 Fixed #7478 -- Rolled QuerySetPaginator into the Paginator class, to simplify things. QuerySetPaginator still exists as an alias, for backwards compatibility. Thanks for the suggestion, batiste@dosimple.ch
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7865 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 02:08:33 +00:00
Gary Wilson Jr 54d50ef5c8 Made legacy `ObjectPaginator` truly backwards-compatible by catching both `AttributeError` and `TypeError` in `_get_count` as it did before
[7306].  Tests included.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-02 04:31:28 +00:00
Malcolm Tredinnick 99150048ac Fixed a problem in the backwards-compat abilities of the paginator. Calling count() on a list throws a TypeError not an AttributeError.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-23 10:14:32 +00:00
Adrian Holovaty d67208f5be Added a new and improved Paginator class, which allows you to pass a Page object to the template instead of 5 or 6 separate variables. ObjectPaginator still exists for backwards compatibility but issues a DeprecationWarning
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7306 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18 21:13:48 +00:00
Gary Wilson Jr 6522e0697a Fixed #5932 -- Use `self.pages` and not `self._pages` in `_get_page_range` so that an exception is not raised if `self.page_range` is accessed before `self.pages`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6702 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-19 06:10:23 +00:00
Russell Keith-Magee 87e77ffca0 Fixed #1795 -- Added page_range to paginators in generic list views. Thanks to polarcowz@gmail.com and Marc Fargas <telenieko@telenieko.com> for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 01:01:02 +00:00
Jacob Kaplan-Moss d4d1a22730 Fixed #2575: ObjectPaginator now accepts a "orphans" option to prevent pages with only a few items. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 04:44:27 +00:00
Jacob Kaplan-Moss 17d0bd1512 Fixed a bunch of spurious imports, typos, and other small errors turned up by a pass through PyFlakes. This covers about the first third of the errors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-21 17:11:13 +00:00
Adrian Holovaty 2abfd5dd58 Fixed #2109 -- Convert old-style classes to new-style classes throughout Django. Thanks, Nicola Larosa
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08 05:00:13 +00:00
Adrian Holovaty cb9cb2045b Fixed #720 -- Added first_on_page() and last_on_page() methods to ObjectPaginator. Thanks, m@bagai.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3040 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 04:29:39 +00:00
Adrian Holovaty f69cf70ed8 MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02 01:31:56 +00:00
Adrian Holovaty 05bdb8d64b Fixed a legacy ordering_tuple --> order_by renaming in core.paginator
git-svn-id: http://code.djangoproject.com/svn/django/trunk@291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-22 05:11:37 +00:00
Adrian Holovaty ed114e1510 Imported Django from private SVN repository (created from r. 8825)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-07-13 01:25:57 +00:00