def update_views(): response,content = http.request("%s/_design/offers" % database_url,'GET') report("Get Views",response,200) old_views = json.loads(content) new_views = json.loads(views) new_views['_id'] = old_views['_id'] new_views['_rev'] = old_views['_rev'] response,content = http.request("%s/_design/offers" % database_url,'PUT', body=json.dumps(new_views), headers=content_header) report("Views",response,201)
def delete_database(): response, content = http.request(database_url, 'DELETE') report("Delete Database",response,200)
def create_views(): response,content = http.request("%s/_design/offers" % database_url,'PUT', body=views, headers=content_header) report("Views",response,201)
def create_database(): response, content = http.request(database_url, 'PUT') report("Database",response,201) create_views()