jfinkels/flask-restless — pull request #355 by andir (2014-09-02 15:33:01+00:00)
Title: Fixed get_related_model with hybrid_property.expression

Previously when using a hyprid_property.expression get_related_model would throw an exception like:

[..]
File "..python3.4/site-packages/flask_restless/views.py", line 1056, in get
return self._search()
File "..python3.4/site-packages/flask_restless/views.py", line 999, in _search
relations = frozenset(get_relations(self.model))
File "..python3.4/site-packages/flask_restless/helpers.py", line 114, in get_relations
return [k for k in dir(model)
File "..python3.4/site-packages/flask_restless/helpers.py", line 116, in
and get_related_model(model, k)]
File "..python3.4/site-packages/flask_restless/helpers.py", line 129, in get_related_model
if isinstance(attr, AssociationProxy):
UnboundLocalError: local variable 'attr' referenced before assignment

I belive the original code was just indented wrong accidentially.