Coder Social home page Coder Social logo

Comments (10)

maxtepkeev avatar maxtepkeev commented on July 27, 2024
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.

danielmanser avatar danielmanser commented on July 27, 2024

Hm, that doesn't work as well.

from python-redmine.

maxtepkeev avatar maxtepkeev commented on July 27, 2024

What is your Redmine version ? Also what does it mean "doesn't work" ? Show me the code please.

from python-redmine.

maxtepkeev avatar maxtepkeev commented on July 27, 2024

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.

danielmanser avatar danielmanser commented on July 27, 2024

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.

maxtepkeev avatar maxtepkeev commented on July 27, 2024

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.

danielmanser avatar danielmanser commented on July 27, 2024

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.

maxtepkeev avatar maxtepkeev commented on July 27, 2024

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.

danielmanser avatar danielmanser commented on July 27, 2024

Uh - yes. Installed via pip :-/

from python-redmine.

maxtepkeev avatar maxtepkeev commented on July 27, 2024

So the problem was in using the old version, right ?

from python-redmine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.