Ticket #6875: custom_queryset_setting.diff
File custom_queryset_setting.diff, 2.8 KB (added by , 17 years ago) |
---|
-
django/db/models/query.py
16 16 # Pull into this namespace for backwards compatibility 17 17 EmptyResultSet = sql.EmptyResultSet 18 18 19 class _QuerySet(object):19 class BaseQuerySet(object): 20 20 "Represents a lazy database lookup for a set of objects" 21 21 def __init__(self, model=None, query=None): 22 22 self.model = model … … 470 470 except StopIteration: 471 471 self._iter = None 472 472 473 # Use the backend's QuerySet class if it defines one. Otherwise, use _QuerySet. 473 # Use the backend's QuerySet class if it defines one. Otherwise, use 474 # the BaseQuerySet subclass defined in settings.DEFAULT_QUERYSET_CLASS 475 qs_path = settings.DEFAULT_QUERYSET_CLASS 476 i = qs_path.rfind('.') 477 module, attr = qs_path[:i], qs_path[i+1:] 478 _QuerySet = getattr(__import__(module, {}, {}, ['']), attr) 479 assert issubclass(_QuerySet, BaseQuerySet) # Must be a subclass of django.db.models.query.BaseQuerySet 474 480 if connection.features.uses_custom_queryset: 475 481 QuerySet = connection.ops.query_set_class(_QuerySet) 476 482 else: -
django/conf/global_settings.py
250 250 # Hint: you really don't! 251 251 TRANSACTIONS_MANAGED = False 252 252 253 # The custom subclass of BaseQuerySet to use in place of all QuerySet instances. 254 DEFAULT_QUERYSET_CLASS = 'django.db.models.query.BaseQuerySet' 255 253 256 # The User-Agent string to use when checking for URL validity through the 254 257 # isExistingURL validator. 255 258 from django import get_version -
AUTHORS
141 141 Afonso Fernández Nogueira <fonzzo.django@gmail.com> 142 142 Matthew Flanagan <http://wadofstuff.blogspot.com> 143 143 Eric Floehr <eric@intellovations.com> 144 Eric Florenzano <floguy@gmail.com> 144 145 Vincent Foley <vfoleybourgon@yahoo.ca> 145 146 Rudolph Froger <rfroger@estrate.nl> 146 147 Jorge Gajon <gajon@gajon.org> -
docs/settings.txt
437 437 Default tablespace to use for indexes on fields that don't specify 438 438 one, if the backend supports it. 439 439 440 DEFAULT_QUERYSET_CLASS 441 ---------------------- 442 443 **New in Django development version** 444 445 Default: ``'django.db.models.query.BaseQuerySet'`` 446 447 Default QuerySet class to use for all operations. Should inherit from 448 ``django.db.models.query.BaseQuerySet`` to provide custom functionality. 449 440 450 DISALLOWED_USER_AGENTS 441 451 ---------------------- 442 452