On Fri, Aug 13, 2010 at 3:08 AM, Benoit Chesneau <bchesneau@gmail.com> wrote:
> You may be interrested in http://github.com/Xjs/couchdbkit-mapper then :)
Thanks for the link. :) The approach (make a dynamic subclass of
both the class you want and of Document) is nice.
Unfortunately, I wasn't able to get the code to work. I'm using a
recent install of couchdbkit; after commenting out the following two
seemingly unnecessary lines from the unit tests:
#from httplib2 import Http
#from restclient.transport import HTTPLib2Transport
I get the following:
$ python -m unittest discover -vbs .
testMapping (test_mapper.MapperTestCase) ... ERROR
testViewResults (test_mapper.MapperTestCase) ... ERROR
======================================================================
ERROR: testMapping (test_mapper.MapperTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/elis/edit/opensource/couchdbkit/mapper/test_mapper.py",
line 54, in setUp
self.db = Mapper(db_name, server=self.server)
File "/Users/elis/edit/opensource/couchdbkit/mapper/mapper.py", line
106, in __init__
super(Mapper, self).__init__(*args, **parameters)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/couchdbkit-0.4.11-py2.7.egg/couchdbkit/client.py",
line 238, in __init__
self.server_uri, self.dbname = uri.rsplit("/", 1)
ValueError: need more than 1 value to unpack
======================================================================
ERROR: testViewResults (test_mapper.MapperTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/elis/edit/opensource/couchdbkit/mapper/test_mapper.py",
line 54, in setUp
self.db = Mapper(db_name, server=self.server)
File "/Users/elis/edit/opensource/couchdbkit/mapper/mapper.py", line
106, in __init__
super(Mapper, self).__init__(*args, **parameters)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/couchdbkit-0.4.11-py2.7.egg/couchdbkit/client.py",
line 238, in __init__
self.server_uri, self.dbname = uri.rsplit("/", 1)
ValueError: need more than 1 value to unpack
----------------------------------------------------------------------
Ran 2 tests in 0.055s
FAILED (errors=2)
Does anyone know if Xjs is a member of this mailing list, and/or is
interested in bug reports?
Eli
|