Skip to content

Commit 665ef31

Browse files
committed
Fixed FieldsPreparer when receiving data with __getattr__
1 parent a4994eb commit 665ef31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: restless/preparers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def lookup_data(self, lookup, data):
101101
part = parts[0]
102102
remaining_lookup = '.'.join(parts[1:])
103103

104-
if hasattr(data, 'keys') and hasattr(data, '__getitem__'):
104+
if callable(getattr(data, 'keys', None)) and hasattr(data, '__getitem__'):
105105
# Dictionary enough for us.
106106
value = data[part]
107107
elif data is not None:

0 commit comments

Comments
 (0)