Attempting to fix issues with resolving nullable foreign keys.

This commit is contained in:
Dave Hall 2014-11-06 10:58:20 +00:00
parent 3f5be2f11b
commit 5c22c17c6e
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View file

@ -11,3 +11,4 @@ Thumbs.db
/MANIFEST
/dist
*.sqlite3
*.egg-info

View file

@ -50,7 +50,9 @@ class SearchAdapter(object):
name_parts = name.split("__", 1)
prefix = name_parts[0]
# Get the attribute.
if hasattr(obj, prefix):
if obj is None:
return ""
elif hasattr(obj, prefix):
value = getattr(obj, prefix)
if not isinstance(value, (QuerySet, models.Manager)):
if callable(value):