Equate queryset model instances with deffered fields to their parent model class when resolving UI model columns.

This will allow models using .defer or .only optimizations to render properly on list views.
This commit is contained in:
Roberto Rosario
2016-05-09 19:55:03 -04:00
parent 8d549df088
commit 55d53bf4d5

View File

@@ -349,7 +349,10 @@ class SourceColumn(object):
try: try:
return cls._registry[source.__class__] return cls._registry[source.__class__]
except KeyError: except KeyError:
return () try:
return cls._registry[source._meta.parents.items()[0][0]]
except IndexError:
return ()
except TypeError: except TypeError:
# unhashable type: list # unhashable type: list
return () return ()