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


Ignore:
Timestamp:
02/06/2013 04:00:22 AM (3 years ago)
Author:
charettes
Comment:

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