Fixed issue with attribute search not properly handling attribute prefixes.

This commit is contained in:
Kelketek 2013-06-29 15:10:14 -05:00
parent c3f86ab45b
commit 240dee1d5b

View file

@ -174,7 +174,8 @@ class ObjectManager(TypedObjectManager):
if isinstance(property_value, basestring):
property_value = to_unicode(property_value)
if isinstance(property_name, basestring):
property_name = "db_%s" % property_name.lstrip('db_')
if not property_name.startswith('db_'):
property_name = "db_%s" % property_name
querykwargs = {property_name:property_value}
cand_restriction = candidates and Q(pk__in=[_GA(obj, "id") for obj in make_iter(candidates) if obj]) or Q()
type_restriction = typeclasses and Q(db_typeclass_path__in=make_iter(typeclasses)) or Q()