Error with Proxy() when remote reference returns empty result set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
With storm 0.18 when using Proxy() to a Reference field, when the Reference is None the attribue access to the Proxy falls over with a seemingly random error message:
AttributeError: "'NoneType' object has no attribute '__dict__'"
function __get__ in references.py at line 417
return self._remote_
function __get__ in properties.py at line 53
return self._get_
function _get_column in properties.py at line 92
column = cls.__dict_
attached is a working example of the bug.
I don't know enough about it to submit a patch, however I believe in the __get__ in Proxy it should be first checking if the the reference object can be retrieved before proceeding. Adding this resolved the issue:
if self._reference
before the return:
return self._remote_
If I can provide anymore info please let me know.
Nick