Run 2to3.
This commit is contained in:
parent
a5a8d9dd57
commit
6fa280b9fd
157 changed files with 976 additions and 976 deletions
|
|
@ -151,7 +151,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
|
||||
# This doesn't work if attribute_value is an object. Workaround below
|
||||
|
||||
if isinstance(attribute_value, (basestring, int, float, bool)):
|
||||
if isinstance(attribute_value, (str, int, float, bool)):
|
||||
return self.filter(cand_restriction & type_restriction & Q(db_attributes__db_key=attribute_name,
|
||||
db_attributes__db_value=attribute_value))
|
||||
else:
|
||||
|
|
@ -196,9 +196,9 @@ class ObjectDBManager(TypedObjectManager):
|
|||
typeclasses (list, optional): List of typeclass-path strings to restrict matches with
|
||||
|
||||
"""
|
||||
if isinstance(property_value, basestring):
|
||||
if isinstance(property_value, str):
|
||||
property_value = to_unicode(property_value)
|
||||
if isinstance(property_name, basestring):
|
||||
if isinstance(property_name, str):
|
||||
if not property_name.startswith('db_'):
|
||||
property_name = "db_%s" % property_name
|
||||
querykwargs = {property_name: property_value}
|
||||
|
|
@ -244,7 +244,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
Returns:
|
||||
matches (list): A list of matches of length 0, 1 or more.
|
||||
"""
|
||||
if not isinstance(ostring, basestring):
|
||||
if not isinstance(ostring, str):
|
||||
if hasattr(ostring, "key"):
|
||||
ostring = ostring.key
|
||||
else:
|
||||
|
|
@ -365,9 +365,9 @@ class ObjectDBManager(TypedObjectManager):
|
|||
typeclasses = make_iter(typeclass)
|
||||
for i, typeclass in enumerate(make_iter(typeclasses)):
|
||||
if callable(typeclass):
|
||||
typeclasses[i] = u"%s.%s" % (typeclass.__module__, typeclass.__name__)
|
||||
typeclasses[i] = "%s.%s" % (typeclass.__module__, typeclass.__name__)
|
||||
else:
|
||||
typeclasses[i] = u"%s" % typeclass
|
||||
typeclasses[i] = "%s" % typeclass
|
||||
typeclass = typeclasses
|
||||
|
||||
if candidates is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue