trying Document.get(doc_id): AttributeError: 'str' object has no attribute 'get'

43 views
Skip to first unread message

Simon Wörpel

unread,
Aug 25, 2013, 7:28:10 PM8/25/13
to couch...@googlegroups.com
Hi folks,

I'm new to couchdbkit and I think I'm just misunderstanding some basic things...

I'm trying to get a single document using my document class. It's simply like:

class MyDoc(Document) 
   property = ...

nothing more... 

But when I try to get it by 

doc = Document.get('doc_id') 

it says:

  File "/...l/lib/python2.7/site-packages/couchdbkit/schema/base.py", line 469, in get
    return db.get(docid, rev=rev, wrapper=cls.wrap)
AttributeError: 'str' object has no attribute 'get'


when I check Document._db it is the right assigned database for my app and the doc by doc_id really exists! What I'am misunderstanding?

Thanks & good night,
Simon

Benoit Chesneau

unread,
Aug 26, 2013, 1:33:45 AM8/26/13
to couch...@googlegroups.com
mmm this API should be removed .... The best way to actually use the Schema with couchdbkit is to do db.open_doc(docid, schema=MySchema)

- benoit
 
--
You received this message because you are subscribed to the Google Groups "couchdbkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to couchdbkit+...@googlegroups.com.
To post to this group, send email to couch...@googlegroups.com.
Visit this group at http://groups.google.com/group/couchdbkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages