Comments (4)
Hi Augustin!
I can't reproduce this problem here. It works for me as it should, can you tell me a little bit more about your environment i.e. Redmine and Python version.
from python-redmine.
Hi Max,
thank you for answering.
I am running Python 2.7.6 and we run ChiliProject (3.2.1.221a2e73c), not a vanilla Redmine. Apologies for not stating this right away, I should have. I didn't think it would be a factor, since the REST API works like it should, returning the right number of items.
Do you have any idea what could cause this discrepancy?
Cheers.
from python-redmine.
I think I found the problem and it's related with this ChiliProject fork of Redmine. Below is the detailed explanation of the problem.
ChiliProject's REST API for time entries doesn't support limit and offset for some reason, you can test that by yourself, e.g. https://YOUR_SERVER/time_entries.json?limit=1 won't work. On the other hand if you try this on native Redmine it will work.
Python-Redmine tries it's best to mimic limit/offset if it's not supported by the Redmine resource itself. So it's also tries to mimic it for the ChiliProject's time entries. But why you get only 25 resources ? Read below.
In ChiliProject you can use per_page and page GET parameters to control what time entries you want to get, by default it's using per_page=25 & page=1, this is why you always get 25 entries.
So what can you do ? You can use python-redmine with parameters per_page and page to get time entries and then make additional request for the next page and check if there are more entries and then make another request if there more etc., e.g:
time_entries = redmine.time_entry.filter(from_date="2014-07-22", per_page=100, page=2)
per_page only supports values of 25, 50 and 100. So you can't do per_page=1 or 10, if you need this you can add limit parameter and python-redmine will limit results manually for you, e.g.:
time_entries = redmine.time_entry.filter(from_date="2014-07-22", per_page=100, page=2, limit=10)
Also I highly recommend you to fill a feature request for the ChiliProject to add support for limit/offset on it's own level to be more compatible with Redmine and also to make requests to API more efficient.
Hope that helps. If you still have questions feel free to ask, if not, feel free to close this issue.
from python-redmine.
Wow, I'm really impressed! You've juste saved me more hours of frustration, by debugging something you are not responsible for.
Thank you very much for your great explanation and for the solution. I'm going to post another issue regarding time entries but this one is solved.
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.