PEP8 x == True should be x is True

This commit is contained in:
Ross Lawley 2013-04-26 11:46:12 +00:00
parent 36993097b4
commit 5e65d27832
3 changed files with 3 additions and 3 deletions

View File

@ -295,7 +295,7 @@ class ComplexBaseField(BaseField):
meta = getattr(v, '_meta', {}) meta = getattr(v, '_meta', {})
allow_inheritance = ( allow_inheritance = (
meta.get('allow_inheritance', ALLOW_INHERITANCE) meta.get('allow_inheritance', ALLOW_INHERITANCE)
== True) is True)
if not allow_inheritance and not self.field: if not allow_inheritance and not self.field:
value_dict[k] = GenericReferenceField().to_mongo(v) value_dict[k] = GenericReferenceField().to_mongo(v)
else: else:

View File

@ -548,7 +548,7 @@ class Document(BaseDocument):
# If _cls is being used (for polymorphism), it needs an index, # If _cls is being used (for polymorphism), it needs an index,
# only if another index doesn't begin with _cls # only if another index doesn't begin with _cls
if (index_cls and not cls_indexed and if (index_cls and not cls_indexed and
cls._meta.get('allow_inheritance', ALLOW_INHERITANCE) == True): cls._meta.get('allow_inheritance', ALLOW_INHERITANCE) is True):
collection.ensure_index('_cls', background=background, collection.ensure_index('_cls', background=background,
**index_opts) **index_opts)

View File

@ -66,7 +66,7 @@ class QuerySet(object):
# If inheritance is allowed, only return instances and instances of # If inheritance is allowed, only return instances and instances of
# subclasses of the class being used # subclasses of the class being used
if document._meta.get('allow_inheritance') == True: if document._meta.get('allow_inheritance') is True:
self._initial_query = {"_cls": {"$in": self._document._subclasses}} self._initial_query = {"_cls": {"$in": self._document._subclasses}}
self._loaded_fields = QueryFieldList(always_include=['_cls']) self._loaded_fields = QueryFieldList(always_include=['_cls'])
self._cursor_obj = None self._cursor_obj = None