Comments (4)
thanks, good catch about timezone! Actually, this is not just about warnings. That behavior could result in weird situations when timezone is different between a database and Django settings, so I made a fix which sets timezone explicitly for both DateField and DateTimeField. Please check v0.8.6
as for TimeField - yeah, I suppose custom field would be a reasonable way to go
from djangoql.
Thanks, that looks great, now I can just have nice "2017-01-02"
in my test (and DjangoQL will correctly set the timezone).
However, one test in my project that was passing before is now failing with AssertionError: 3 != 0
:
http_status, response_json = self._get(
'/users/user_1/meals/',
{'filter': 'datetime_created ~ "2017-01-01"'},
)
assert_equal(3, response_json['count'])
I didn't know how to write "from a given day" on the first place (datetime_created = "2017-01-01"
is not equivalent, it gets items from one second "2017-01-01 00:00:00"
).
I found out that datetime_created ~ "2017-01-01"
worked. However it stopped working with 0.8.6.
Any advice?
from djangoql.
interesting. I never thought about LIKE comparisons for datetime fields, so it was supported basically by accident :) However, this is an obviously useful case, so I added explicit support for it as well. Your case should be working back with v0.8.8 (please let me know if it doesn't)
from djangoql.
Works like a charm, thank you.
from djangoql.
Related Issues (20)
- Bug in custom AdminSite HOT 2
- DjangoQLSchemaSerializer in drf Viewsets HOT 1
- Consider vendoring `ply` HOT 2
- Related names
- Logos in `README.rst` are hard to read in Dark Mode
- search triggers AWS WAF because the query looks like a sql injection HOT 2
- Django 4.2 compatibility HOT 1
- Localization of exceptions shown in the UI
- [Feature request] Add regex operator HOT 1
- [BUG] search_mode_toggle_enabled() is not properly working when using get_search_fields()
- Not working with Unfold Admin HOT 1
- Duplicate results in reverse ForeignKey lookup HOT 3
- Steps to bundle the completion HOT 3
- Contains on M2M models produces same result multiple times HOT 1
- Support of Django 4.0 HOT 2
- Collectstatic on Django 4 fails due to missing map file HOT 1
- Search on Oracle Backend HOT 1
- Dealing with JSONFields
- Request for dedicated wiki page / tutorial on how to include DjangoQL autocompletion on webpage HOT 3
- Search for `in ("")` raises strptime() error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djangoql.