Changes between Initial Version and Version 1 of Ticket #15363, comment 12


Ignore:
Timestamp:
Feb 6, 2013, 4:00:22 AM (11 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15363, comment 12

    initial v1  
    1 I gave a try at the metaclass approach and it works great. Have a look at the added tests.
     1I gave a try at the metaclass approach and it works great.
     2
     3Introduced a `DeprecatedGetQuerySet` type which does the following:
     4
     5- Issue a warning on class creation if `get_query_set` is defined.
     6- Raise an `ImproperlyConfigured` error if both `get_queryset` and `get_query_set` are defined.
     7- Define a `get_queryset` method if not present.
     8- Define or wrap the existing `get_query_set` to complain when called.
     9
     10The added tests pass on Python 2.7.3/3.2.3 SQLite without raising a warning.
Back to Top