コード例 #1
0
ファイル: entities.py プロジェクト: presentover/YaPooL
 def create(self):
   self.type='profile'
   if self.owner :
     self.store(loadDatabase (getServer(),dbname=dblayer.YAPOOL_DB))
     return True
   else : 
     return False
コード例 #2
0
 def create(self):
     self.type = 'profile'
     if self.owner:
         self._id = self.owner
         self.store(loadDatabase(getServer(), dbname=dblayer.YAPOOL_DB))
         return True
     else:
         return False
コード例 #3
0
ファイル: tests.py プロジェクト: uj-on-kaist/Kuestions
def switchToTestDatabase(replicate=True) :
  '''
  this method change the database to a test database
  the default argument replicate mean that the database is replicate from the original
  so the design document are replicated
  '''
  print '\n------------------Running the couchdbinterface test -------------------------\n'
  print 'switching to test database'
  #easy way to make sure we have a clean database
  dblayer.db=loadDatabase(server,TEST_DB_NAME)
  if replicate :
    server.replicate(dblayer.DB_NAME,TEST_DB_NAME)
  print 'DATABASE TEST ENVIRONMENT: ',server,',',getDb()