Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

client.Document vs schema.Document #41

Closed
djc opened this issue Jul 12, 2014 · 1 comment
Closed

client.Document vs schema.Document #41

djc opened this issue Jul 12, 2014 · 1 comment
Labels

Comments

@djc
Copy link
Owner

djc commented Jul 12, 2014

From kochhar...@gmail.com on December 04, 2008 02:40:37

Hello,

This is not an issue but a question. I could not find a discussion group or
a mailing list, please direct me if this isn't the appropriate forum.

I'm trying to understand how to use client.Document and schema.Document
objects in couchdb-python. For my use I don't need to map JSON documents to
python objects. However, I'm finding it cumbersome to convert responses
from the database to schema.Document objects in order to have access to
general purpose methods such as load, store and items. The similar names
also complicates keeping track of the class of an object.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=40

@djc
Copy link
Owner Author

djc commented Jul 12, 2014

From cmlenz on July 02, 2009 06:22:07

About the similar naming see issue 13 .

If you don't need mapping to Python objects, you don't need couchdb.schema.

The load() and store() functions are just convenience functions for mapped objects. The basic functionality of
loading and storing documents is available in couchdb.client.Database class (getitem and setitem,
basically). A couchdb.client.Document is basically just a dictionary, so it provides an items() method and
everything else you find on regular Python dicts.

Status: Invalid

@djc djc closed this as completed Jul 12, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant