mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31223 -- Added __class_getitem__() to Manager and QuerySet.
This commit is contained in:
@@ -35,6 +35,9 @@ class BaseManager:
|
||||
"""Return "app_label.model_label.manager_name"."""
|
||||
return '%s.%s' % (self.model._meta.label, self.name)
|
||||
|
||||
def __class_getitem__(cls, *args, **kwargs):
|
||||
return cls
|
||||
|
||||
def deconstruct(self):
|
||||
"""
|
||||
Return a 5-tuple of the form (as_manager (True), manager_class,
|
||||
|
||||
@@ -323,6 +323,9 @@ class QuerySet:
|
||||
qs._fetch_all()
|
||||
return qs._result_cache[0]
|
||||
|
||||
def __class_getitem__(cls, *args, **kwargs):
|
||||
return cls
|
||||
|
||||
def __and__(self, other):
|
||||
self._merge_sanity_check(other)
|
||||
if isinstance(other, EmptyQuerySet):
|
||||
|
||||
Reference in New Issue
Block a user