miLibris / flask-rest-jsonapi

Flask extension to build REST APIs around JSONAPI 1.0 specification.
http://flask-rest-jsonapi.readthedocs.io
MIT License
597 stars 153 forks source link

Sqlalchemy properties throws error when sorted #44

Closed shubham-padia closed 7 years ago

shubham-padia commented 7 years ago

Step to reproduce: When using a hybrid property as follows:

@hybrid_property
    def email(self):
        return self._email

    @email.setter
    def email(self, email):
        self._email = email

In raw SQL query, you get order by table.email (the email column doesn't exist in the actual table) instead of order by table._email A possible fix for this is here: https://github.com/shubham-padia/flask-rest-jsonapi/commit/3c622710168c97ed56d6a827ec7e75c2fe0ee9ca If this seems okay, I can make a PR for it :) .

akira-dev commented 7 years ago

Yes you're right. I have used your PR to fix the issue. And your code is better than mine. Fixed in d22d5959aeada3eea8627a83157f4f96dea9936b

akira-dev commented 7 years ago

New release of Flask-REST-JSONAPI is available on Pypi 0.12.6