mirror of https://github.com/django/django.git
Fixed #19576 -- Use `six.with_metaclass` uniformously accross code base.
This commit is contained in:
parent
55da775ce1
commit
f58efd07ff
|
@ -311,7 +311,7 @@ class ModelState(object):
|
||||||
self.adding = True
|
self.adding = True
|
||||||
|
|
||||||
|
|
||||||
class Model(six.with_metaclass(ModelBase, object)):
|
class Model(six.with_metaclass(ModelBase)):
|
||||||
_deferred = False
|
_deferred = False
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
@ -990,7 +990,7 @@ class InstanceCheckMeta(type):
|
||||||
def __instancecheck__(self, instance):
|
def __instancecheck__(self, instance):
|
||||||
return instance.query.is_empty()
|
return instance.query.is_empty()
|
||||||
|
|
||||||
class EmptyQuerySet(six.with_metaclass(InstanceCheckMeta), object):
|
class EmptyQuerySet(six.with_metaclass(InstanceCheckMeta)):
|
||||||
"""
|
"""
|
||||||
Marker class usable for checking if a queryset is empty by .none():
|
Marker class usable for checking if a queryset is empty by .none():
|
||||||
isinstance(qs.none(), EmptyQuerySet) -> True
|
isinstance(qs.none(), EmptyQuerySet) -> True
|
||||||
|
|
Loading…
Reference in New Issue