caxiam / sqlalchemy-jsonapi-collections

Package for facilitating JSON API sorting, paging, filtering and compound documents with SQLAlchemy collections.
Apache License 2.0
1 stars 1 forks source link

Python V3 compatibility #6

Closed Raistlfiren closed 8 years ago

Raistlfiren commented 8 years ago

Hey, I ran across your project when exploring compound documents with JSONAPI. Anyway, we are using v3.5 of python to handle our own project so I thought I would upgrade compatibility. MY changes should be compatible with v2 and 3 of Python.

cmanallen commented 8 years ago

@Raistlfiren Thanks for the pull! The code looks really good. I'll give it a thorough review tomorrow morning and (hopefully) accept it.

I'm very happy to hear you're using the library but I really need to stress a few points:

I'm in the process of writing better documentation. If you're reading the docs and something doesn't make sense or it needs more clarity, please let me know.

Raistlfiren commented 8 years ago

I completely understand. I debated on not doing the PR since I am sure this project is still in Alpha stages, if that. Although, I believe it can be compatible with both Python versions without much effort.

I don't know a whole lot of Python, but I am slowly working on that. The project that I am working on actually uses Flask, SQLAlchemy, and marshmallow-jsonapi. Although, we use the SQLAlchemy Expression Language NOT the ORM. So I am hoping to add that to either just my fork or both.

I was looking at integrating included relationships in the marshmallow-jsonapi until I saw this repository and realized the include should actually be a GET parameter requested in the URL, not something you specify in the schema.

Interesting, I didn't realize you created a custom Relationship field. Is there a reason you didn't build on the marshmallow-jsonapi Relationship field?

cmanallen commented 8 years ago

@Raistlfiren I do. I just need a special related_schema kwarg so that I can relate multiple schemas together. It allows you to do things like filter[relationship.attribute]=. Without the related schema I wouldn't know if that dot separated attribute was real or not. I should probably open up a pull on marshmallow-jsonapi.

Raistlfiren commented 8 years ago

Yeah I saw the field was more for the included schema section. Thanks for putting this all together. :)

Are you planning on supporting the page and fields parameters?

cmanallen commented 8 years ago

@Raistlfiren page is definitely on the list. fields is probably on the list. I think its easy to implement so I'll probably add some handling around it.