Skip to content

Instantly share code, notes, and snippets.

@backerman
Created April 26, 2010 21:40
Show Gist options
  • Save backerman/379966 to your computer and use it in GitHub Desktop.
Save backerman/379966 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Self-contained test case for couchdbkit issue #9
from couchdbkit import *
SERVER_URI="http://localhost:5984/"
DATABASE_NAME="kanji"
class Ship(Document):
shipClass = StringProperty()
shipName = StringProperty()
ships = []
ships.append(Ship(
shipClass="General Systems Vehicle",
shipName="Sleeper Service"))
ships.append(Ship(
shipClass="General Contact Unit",
shipName="Very Little Gravitas Indeed"
))
db = Server(uri=SERVER_URI).get_or_create_db(DATABASE_NAME)
db.bulk_save(ships)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment