| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
CouchableDb
Currently, though it is not documented here, the .db parameter is part of the public API of CouchableDb; it is required for use with views, etc. Please see the couchdb documentation for details:
http://packages.python.org/CouchDB/
It is possible that in the future couchdbkit could also be used:
| Instance Methods | |||
|
|||
| str |
|
||
|
|||
| str or list |
|
||
| obj or list |
|
||
|
Inherited from |
|||
| Properties | |
|
Inherited from |
| Method Details |
Creates a CouchableDb wrapper around a couchdb.Database object. If the database does not yet exist, it will be created.
|
Creates a view that only emits records for documents of the specified class. Each record also emits keys based on the parameters given, which can be used for things like "get all Foo instances with bar between 3 and 7." The view code resembles the following:
function(doc) {
if ('couchable:' in doc) {
var info = doc['couchable:'];
if (info.module == '$module' && info.class == '$cls') {
$emit
}
}
}
This behavior may change during the course of the 0.x.x series of releases.
|
Stores the documents in the Any attachments for the document will also be uploaded. As of the current revision (0.0.1b2), each attachment will be uploaded each time the document is stored. This behavior is expected to change during the course of the 0.x.x series of releases. Any objects referenced by the object(s) in This behavior may change during the course of the 0.x.x series of releases. Any cycles comprised entirely of non-document classes will cause the store call to raise an exception. Cycles where at least one object in the cycle is to be stored as a top-level document are fine. This behavior may change during the course of the 0.x.x series of releases.
|
Loads the indicated object(s) out of CouchDB. Loading an ID multiple times will result in getting the same object
returned each time. Subsequent loads will return the same object again,
but with an updated Behavior of loading old document revisions is untested at this time. If what is a dict or a couchdb.client.Row, then the values will be used from that object rather than re-fetching from the database. Likewise, the loaded parameter can be used to prevent multiple DB hits. This can be useful when loading multiple documents returned by a view, etc. Example use:
cdb.load(cdb.db.view('couchable/' + viewName, include_docs=True, startkey=[...], endkey=[..., {}]).rows)
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 4 15:24:14 2010 | http://epydoc.sourceforge.net |