nickesk / pyactiveresource

Automatically exported from code.google.com/p/pyactiveresource
Other
0 stars 0 forks source link

Does not retrieve all expected information from a Redmine issue #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run the script below, suitably updated with server base URL and with a 
suitable accesskey in the file opened, against a Redmine server.
2. It will retrieve open issues.
3. The retrieved open issues objects will have numerous fields filled out (e.g 
"subject" and "description" with useful information, but while a "status" key 
is present it's value is always 'None' (maybe there are some others missing too 
but I haven't looked beyond status).  Note that "status" is certainly present 
in the XML being accessed.

-----
#!/usr/bin/env python

from pyactiveresource.activeresource import ActiveResource

server='http://editechnology:8001/redmine'

class Redmine(ActiveResource):
    _site = server
    _user = open('accesskey').readline().strip()  
    _password = 'dummy'

def main():
    issues=Redmine.find(from_=server+'/issues.xml')
    for i in issues:
        print '----------------------'
        print i
        print i.subject
        print i.status
        print i.to_dict()

if __name__ == "__main__":
    main()
-----

What is the expected output? What do you see instead?

Well I'd expect to see information like "New" and "Backlog" in the status field 
(and/or the ID's corresponding to such).

Interestingly, if I simply point my browser at redmine/issues.xml, the issues 
retrived clearly all have entries like "<status name="Backlog" id="7"/>" 
included.

What version of the product are you using? On what operating system?

I'm on Debian Squeeze (Python 2.6.6) using pyactiveresource 1.0.1 (installed 
via pip) against a Redmine 1.4.4 stable.

Please provide any additional information below.

Thanks for any help with a solution!
Tim

Original issue reported on code.google.com by tim...@gmail.com on 21 Dec 2012 at 5:35

GoogleCodeExporter commented 9 years ago
I've just had time to look at this for the first time since I created this 
issue.

Replacing my pip installed pyactiveresource with one obtained from here with

  svn checkout http://pyactiveresource.googlecode.com/svn/trunk/ pyactiveresource
  cd pyactiveresource
  python setup.py build
  sudo python setup.py install

and my Redmine accessing code now seems to be working great and the retrieved 
dicts contain things like
  'status': {'name': 'New', 'id': '1'}
as expected.

So please consider the issue closed (although it'd be nice if the version 
retrieved via pip was updated, but I don't know enough about the Python 
ecosystem to know who takes care of that sort of thing, or even where pip's 
idea of a 1.0.1 version comes from when there's no tags/branches on the google 
code repo)

Original comment by tim...@gmail.com on 4 Jan 2013 at 5:08