def __init__(self, **options): CouchObject.__init__(self) self.cdb_document_data = "group" self.setdefault('name', None) self.setdefault('administrators', []) self.setdefault('associated_sites', {}) self.update(options)
def __init__(self, **options): CouchObject.__init__(self) self.cdb_document_data = "user" self.setdefault('name', None) self.setdefault('proxy', {}) self.couch_url = None self.couch_db = None self.group = None self.update(options)
def testA(self): """test connection""" cObj = CouchObject() cObj.cdb_database = self.database cObj.cdb_url = self.url self.assertEqual(cObj.connected, False) cObj.connect() self.assertEqual(cObj.connected, True)
def create(self): """ _create_ Overide the base class create to make sure the group exists when adding the user (Note: Overriding wipes out decorators...) """ if not self.couch.documentExists(self.group.document_id): # no group => create group self.group.create() # call base create to make user CouchObject.create(self)
def __init__(self): CouchObject.__init__(self) self.cdb_document_data = "testicle" self.setdefault("name", "noname") self.setdefault("Right", "Nut") self.setdefault("Left", "Nut")