views are views or string ?

67 views
Skip to first unread message

bussiere adrien

unread,
Aug 25, 2012, 3:01:02 AM8/25/12
to couch...@googlegroups.com
i've made this little code :
           
emailcouchs = Email.view('email/all')
print emailcouchs
print emailcouchs.count()


so it give me this error :
<couchdbkit.client.ViewResults object at 0x1d68110>
Traceback (most recent call last):
  File "saveemailpa.py", line 67, in <module>
    print emailcouchs.count()
  File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 973, in count
    self._fetch_if_needed()
  File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 1004, in _fetch_if_needed
    self.fetch()
  File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 987, in fetch
    self._total_rows = self._result_cache.get('total_rows')
AttributeError: 'str' object has no attribute 'get'


So it seems that the print tells me that ok it's a view object but it fails after and it seems that it's a string.

Any idea anyone ?

Regards
Bussiere


Benoit Chesneau

unread,
Aug 25, 2012, 4:49:38 AM8/25/12
to couch...@googlegroups.com
Which version of couchdbkit are you using? Can you enable logging ?

from restkit import set_logging
set_logging("debug")

Also any logs from couchdb?

- benoît

bussiere bussiere

unread,
Aug 25, 2012, 5:12:50 AM8/25/12
to couch...@googlegroups.com
the latest with pip.


and with your instruction :

Traceback (most recent call last):
File "/home/bussiere/saveemail/testcouchdb.py", line 13, in <module>
emailcouchs = Email.view('email/all')
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/schema/base.py",
line 585, in view
db = cls.get_db()
File "/usr/local/lib/python2.7/dist-packages/couchdbkit/schema/base.py",
line 422, in get_db
raise TypeError("doc database required to save document")
TypeError: doc database required to save document
[Finished in 0.6s]

thanks by the way.

Bussiere

"Les nouvelles technologies offrent pleins de nouvelles possibilités,
pleins de possibilités d'erreurs surtout en fait."
insurance.aes256 : http://goo.gl/gHyAY
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.7.96rc1

mQGiBE9sjdsRBADsY+DaDgj+pDuGLNVL6Dc+ghCxaE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PHf8OifWmeUDPlzm4txvR5a7t4hhVDehek1J7FEVvfG+ffcHiPP
kkFaUv2EgrXziozt/Vkr2nngsKO5FpRJe9GSqn68uZirhwbkHSKX6LPNFTWSYR3E
fefnsCaP82OJDBFGFMg2aMsz9QL85bg58fgHU972kLTePXUVAh3gaxb6qpjwZt2b
yrCGJ/rnmIc/IWH8TJtHI5Yf3Abx2vlFTtzRH0CwVXuO0msjcfRrrrrS8NSm/ih5
0ssElxKU6IhGBBgRAgAGBQJPbI3eAAoJEBinNlag8/tvoBEAn2Yqu0UFC5OSjD1Y
JQ00FFjNVestAJ0XctcbmhKaFuQ46SccW8C2JDG/xA==
=+VZi
-----END PGP PUBLIC KEY BLOCK-----

Benoit Chesneau

unread,
Aug 25, 2012, 10:15:49 AM8/25/12
to couch...@googlegroups.com

On Aug 25, 2012, at 11:12 AM, bussiere bussiere <buss...@gmail.com> wrote:

> the latest with pip.
>
>
> and with your instruction :
>
> Traceback (most recent call last):
> File "/home/bussiere/saveemail/testcouchdb.py", line 13, in <module>
> emailcouchs = Email.view('email/all')
> File "/usr/local/lib/python2.7/dist-packages/couchdbkit/schema/base.py",
> line 585, in view
> db = cls.get_db()
> File "/usr/local/lib/python2.7/dist-packages/couchdbkit/schema/base.py",
> line 422, in get_db
> raise TypeError("doc database required to save document")
> TypeError: doc database required to save document
> [Finished in 0.6s]
>
> thanks by the way.

Looks like another error. Could you open a ticket I will look at it over the week-end.

- benoît
> --
> You received this message because you are subscribed to the Google Groups "couchdbkit" group.
> To post to this group, send email to couch...@googlegroups.com.
> To unsubscribe from this group, send email to couchdbkit+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/couchdbkit?hl=en.
>

bussiere bussiere

unread,
Aug 25, 2012, 12:10:16 PM8/25/12
to couch...@googlegroups.com
ok i will thanks to you.

Ok je vais le faire merci a vous.
Reply all
Reply to author
Forward
0 new messages