Pegase745 / sqlalchemy-datatables

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

use regex for data retrieval? #40

Closed louking closed 8 years ago

louking commented 8 years ago

as of sqlalchemy-datatables 0.2.1 queries from multi-select field type are not supported (e.g., from yadcf, see http://stackoverflow.com/questions/32855901/yadcf-with-select2-puts-empty-selected-option)

the actual "non-support" is for columns where regex is True, coming from dataTables client

regex is supported by sqlalchemy for some dialects, e.g., see http://stackoverflow.com/questions/27228635/how-can-a-sqlalchemy-query-use-mysqls-regexp-operator

not sure if it would be sufficient to support | (OR) operator through hard coding, which will allow multi-selects

for my current need, hard coded support of OR operator, or mysql support of regex would be sufficient, but that is not a complete solution

louking commented 8 years ago

I'm working on a pull request.

But see http://datatables.net/forums/discussion/33699/search-regex-sub-expression-error

Pegase745 commented 8 years ago

Sorry for not having the time before now to look into that, but go on with the pull request and will help asap! Thanks On Mar 8, 2016 8:14 PM, "Lou King" notifications@github.com wrote:

I'm working on a pull request.

But see http://datatables.net/forums/discussion/33699/search-regex-sub-expression-error

— Reply to this email directly or view it on GitHub https://github.com/Pegase745/sqlalchemy-datatables/issues/40#issuecomment-193923756 .

louking commented 8 years ago

Thanks. I have two pull requests in now, for #38 and this issue

Not sure how much you will like this one because it makes use of special features provided by mysql and postgresql dialects

Also not handled well is invalid regex from table search box, query outstanding to dataTables. I can continue working on this aspect or maybe it's a dataTables change depending on Allan's answer.

You can see this pull request working at http://sandbox.steeplechasers.org/scoretility/results?club=fsrc for multi_select of Name field