Closed tdamsma closed 7 years ago
As this became active again, there are few open issues and pull request which can be also looked right away. The one which I encountered were in regex/search while throws exception when seared for integer as the replace method don't exist
@devcorn, could you add some tests to illustrate the issue? I already put in code to cast values to string before doing a global search. For per column searches, using regexes on numerical values just feels wrong. I added a search_method='numeric'
option which allows for searches as >=10
to return values greater than or equal to 10.
Alternatively, you can use the yadcf plugin in combination with search_method='yadcf_range_number_slider'
to provide sliders for searching numerical data.
@Pegase745 Even though there are some todo's left, I think the PR is ready to be merged. Perhaps you can have look
@tdamsma Great job indeed. I'll take a deeper look tonight if you won't mind and merge the whole thing :+1:
As discussed here
The main idea is that instead of passing an
sqla_object
,query
, andcolumns
, only pass thequery
and thecolumns
. And instead of passing the columns by name, one can pass any SQLAlchemy column like expression, likefunc.upper(User.name)
.An example:
Without datatables, a query can look like this:
Currently, with sqlalchemy datatables there is no way to calculate the age on the fly using sql statements. In my implementation, you have to split the query and the columns and pass those to DataTables:
If you check the code, you can see it is much cleaner, as dealing with joins, properties etc are made by sqlachemy. The result of the query is determined operating on the sqlalchemy expressions.
TODO:
add more testsreimplement regexreturn error messages in the data structure