Fixed a caching issue with TypedAttributes.

This commit is contained in:
Griatch 2012-03-29 20:30:35 +02:00
parent 82a10903d1
commit d4c97d7df8
3 changed files with 18 additions and 5 deletions

View file

@ -119,8 +119,10 @@ class ObjectManager(TypedObjectManager):
from src.objects.models import ObjAttribute
lstring = ""
if location:
lstring = ", db_obj__db_location=location"
lstring = ", db_obj__db_location=location"
attrs = eval("ObjAttribute.objects.filter(db_key=attribute_name%s)" % lstring)
# since attribute values are pickled in database, we cannot search directly, but
# must loop through the results. .
if exact:
return [attr.obj for attr in attrs if attribute_value == attr.value]
else: