-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date_from/date_to Filter #8
Comments
time_entries = redmine.time_entry.filter(from_date='2013-12-03', to_date='2013-12-03') Currently the from_date and to_date params accepts a string only in the format that is used by your Redmine server. |
Hm, that doesn't work as well. |
What is your Redmine version ? Also what does it mean "doesn't work" ? Show me the code please. |
Also please do this request directly in your browser:
Of course change the dates to the ones you need and have a look at the returned result. Does it work this way ? |
My Redmine version is 2.1.0.stable. No matter what I set for date_from/date_to or from_date/to_date, I always get all entries (so they are not filtered). I don't get an error. Trying your example from above directly in the browser, however, I can filter. So I get only the entries for 2013-12-02. The code I'm using is:
This code gives me also entries for 2011, 2012 and 2014. |
If the in-browser filtering works, it should also work via python-redmine. There is an error in the code you provided: the parameters are wrong: they should be from_date/to_date instead of date_from/date_to in your code. This is important. |
Thanks for your quick response. It doesn't work with from_date/to_date as well (which is what I've tried in the beginning, according to the docs). Also, I don't get an error. It seems like the two arguments aren't parsed at all. I'll do some debugging now, maybe I can provide more info. |
Are you using the 0.5.0 version of python-redmine ? I'm asking because this parameters only work starting from 0.4.0. Also please check redmine.resources.TimeEntry class, there should be a translate_params class method where a translation of this params occures. You can start debugging from here. |
Uh - yes. Installed via pip :-/ |
So the problem was in using the old version, right ? |
According to the docs, one can filter time entries from/to a specific date. I've tried with a few date formats, but it seems the filter does not work. What is the correct date format (according to the docs, a string)?
The text was updated successfully, but these errors were encountered: