Join GitHub today
Resolve datetime strings to datetime objects as required by model. #379
I noticed that when you did when searching, the date search terms would just get forwarded to the database without any attempt at checking their validity-- so something like:
Would just get forwarded on to the database, which means that your query values need to match your database's date/time representations. And at least in the case of sqlite, you'll get results returned for that query mentioned above, which I don't believe should be expected.
I noticed that you use dateutil.parser to handle the date-strings resolution using the
If you now pass a bad date in, the use will get an
In addition, because it's now using dateutil parsing on those params, it allows you to run date queries in a number of formats and get the expected results, eg:
I think I'm fairly happy with this pull-request now. It'll now allow you to search in any format that
Please let me know your thoughts when you're able.