Skip to content

Instantly share code, notes, and snippets.

@JoshAshby
Created September 8, 2011 22:20
Show Gist options
  • Save JoshAshby/1204935 to your computer and use it in GitHub Desktop.
Save JoshAshby/1204935 to your computer and use it in GitHub Desktop.
Couchdbkit
import couchdbkit
database = couchdbkit.Server()["stats"]
class productDoc(couchdbkit.Document):
barcode = couchdbkit.StringProperty()
productDoc.set_db(database)
#these two both return a ViewResults object instead of the results
a = productDoc.view("products/all", include_docs=True)[0]
a = database.view("products/all", include_docs=True)[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment