Ticket #19576: 0001-Fixed-19576-Use-six.with_metaclass-uniformously-accr.patch

File 0001-Fixed-19576-Use-six.with_metaclass-uniformously-accr.patch, 1.3 KB (added by Simon Charette, 12 years ago)
  • django/db/models/base.py

    From cd5bd88ffac17df18a4208fe532c5266e906f323 Mon Sep 17 00:00:00 2001
    From: Simon Charette <charette.s@gmail.com>
    Date: Mon, 7 Jan 2013 23:41:59 -0500
    Subject: [PATCH] Fixed #19576 -- Use `six.with_metaclass`  uniformously
     accross code base.
    
    ---
     django/db/models/base.py  |    2 +-
     django/db/models/query.py |    2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index bd638e2..38afc60 100644
    a b class ModelState(object):  
    311311        self.adding = True
    312312
    313313
    314 class Model(six.with_metaclass(ModelBase, object)):
     314class Model(six.with_metaclass(ModelBase)):
    315315    _deferred = False
    316316
    317317    def __init__(self, *args, **kwargs):
  • django/db/models/query.py

    diff --git a/django/db/models/query.py b/django/db/models/query.py
    index edc8cc9..bdb6d48 100644
    a b class InstanceCheckMeta(type):  
    990990    def __instancecheck__(self, instance):
    991991        return instance.query.is_empty()
    992992
    993 class EmptyQuerySet(six.with_metaclass(InstanceCheckMeta), object):
     993class EmptyQuerySet(six.with_metaclass(InstanceCheckMeta)):
    994994    """
    995995    Marker class usable for checking if a queryset is empty by .none():
    996996        isinstance(qs.none(), EmptyQuerySet) -> True
Back to Top