Pegase745 / sqlalchemy-datatables

SQLAlchemy integration of jQuery DataTables >= 1.10.x (Pyramid and Flask examples)
MIT License
159 stars 67 forks source link

Execute function on ColumnDT result? #115

Closed eddieparker closed 5 years ago

eddieparker commented 5 years ago

I couldn't find the docs mentioned in the front page (404'd), so apologies if this is covered somewhere.

I have a column that has a JSON associative array stored, and I'd like to extract known keys from it as part of the ColumnDT call. Is there a way to do this in the ColumnDT call so as to make sorting/filtering/etc work?

Pegase745 commented 5 years ago

Could you plug a test example to see please ? Now that I revamped the examples on master branch, it should be easier to share those toughts

tdamsma commented 5 years ago

You can use sqlalchemy to extract nested jsons, just treat them like a dict

Something like ColumnDT(Model.jsonbfield["mykey"])