sqlalchemy-filters
sqlalchemy-filters copied to clipboard
filter on DateTime and Time sqlalchemy column types
Hello!
I'm currently using this library but it seems like I'm not able to use operators gt and eq on sqlalchemy's Time column type.
I guess it is comparing using the value string representation of the information.. am I right? Is there a way to override the comparator for a particular column or at least override it globally?
Thank you
Hi @asabellico , I'm glad you're using the library! Please let me take a look at it to see exactly what the behaviour is and how we could improve it.
Hi @asabellico, I've taken a look at both datetime.time
and datetime.datetime
objects passed as filters to apply_filters
and I can't see any problems with that on either MySQL or PostgreSQL.
Are you using a different DBMS (maybe SQLite)? If not, can you please provide an example of how you're trying to use it and how it fails (including the version of the DBMS you're using)?
You can see an example of datetime
filters (passed as datetime
objects) in the TestDateTimeFields
class here https://github.com/juliotrigo/sqlalchemy-filters/blob/master/test/interface/test_filters.py#L760
I have also added some extra logic to test both datetime.time
and datetime.datetime
objects, also using isoformat
('03:05:09'
, '2016-07-14T03:05:09'
): #38