Comments (10)
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.
from python-redmine.
Hm, that doesn't work as well.
from python-redmine.
What is your Redmine version ? Also what does it mean "doesn't work" ? Show me the code please.
from python-redmine.
Also please do this request directly in your browser:
http://your_redmine_server/time_entries.json?from=2013-12-02&to=2013-12-02
Of course change the dates to the ones you need and have a look at the returned result. Does it work this way ?
from python-redmine.
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:
time_entries = redmine.time_entry.filter(project_id='projectname', date_from='2013-01-01', date_to='2013-12-01')
This code gives me also entries for 2011, 2012 and 2014.
from python-redmine.
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.
from python-redmine.
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.
from python-redmine.
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.
from python-redmine.
Uh - yes. Installed via pip :-/
from python-redmine.
So the problem was in using the old version, right ?
from python-redmine.
Related Issues (20)
- tags from task HOT 2
- check the existence of a task HOT 1
- Copy project HOT 2
- Is it possible to integrate a "geojson" parameter in issue creation? HOT 2
- KeyError: 'time_entry' HOT 3
- Cant Set priority_id HOT 5
- When adding a user to a group that they are already a member of get "User is invalid" HOT 2
- How to: Create Issue onbehalf of another user HOT 4
- Bug: User does not return status HOT 3
- Bug: Users.all() does not return all users HOT 4
- When querying resources, why is there a default_includes HOT 2
- Leaks API key on exception HOT 2
- Filter by application subject HOT 2
- BytesIO is not JSON serializable HOT 4
- ResourceNotFoundError: Requested resource doesn't exist HOT 2
- Get Request - ResourceNotFoundError: Requested resource doesn't exist HOT 2
- filter error HOT 2
- ???????? for Russian text HOT 6
- adding custom fields to project HOT 2
- Get member users from project_membership HOT 2
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 python-redmine.