Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed get_related_model with hybrid_property.expression #355

Merged
merged 1 commit into from Sep 3, 2014

Commits on Sep 2, 2014

  1. 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 <listcomp>
        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.
    andir committed Sep 2, 2014
    Copy the full SHA
    f5d2fd1 View commit details
    Browse the repository at this point in the history