本文整理汇总了Python中project.model.Project.create方法的典型用法代码示例。如果您正苦于以下问题:Python Project.create方法的具体用法?Python Project.create怎么用?Python Project.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project.model.Project
的用法示例。
在下文中一共展示了Project.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_test_load_data
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_test_load_data():
project = Project()
project.create('test load data',' list entries')
content = "a,b,c\n1,2,3\n4,5,6"
f = MockFile('test_data.csv',content)
entry_id = project.add_entry('test entries','test entries','test_entries','testdata')
project.add_datafile(entry_id,f)
示例2: setup_user
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_user():
user = User()
user.create('test_user','test_pass','[email protected]')
project = Project()
project.create('scraped','scraped')
project.add_entry('entry','entry','localhost')
user.add_project(project.get_id())
示例3: setup_project_update
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_project_update():
user = User()
user.create('test_update_user','test_password','[email protected]')
project = Project()
project.create('project update','test project update')
user.add_project(project.get_id())
project.add_entry('data','test data','data')
示例4: setup_test_update
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_test_update():
mongo = MongoModel(project='test_api_update',collection='test_api_entry')
mongo.insert({'a':1})
user = User()
user.create('test_user_api_update','test_pass','[email protected]')
project = Project()
project.create('test api update','scraped')
project.add_entry('test api entry','entry','localhost')
user.add_project(project.get_id())
示例5: setup_user_project
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_user_project():
# now create user
user = User()
user.create('test_user_update_project','test_pass','[email protected]')
# create project
project = Project()
project.create('project update','project update content')
# associate project
user.add_project(project.get_id())
示例6: setup_project
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_project():
data = (
('project 1','project content 1'),
('project 2','project content 2'),
('project 3','project content 3')
)
for d in data:
project = Project()
project.create(d[0],d[1])
示例7: project_create
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def project_create():
form = ProjectForm(csrf_enabled=False)
print "processing form"
if form.validate_on_submit():
print 'form submitted'
project = Project()
project.create(form.name.data,form.description.data)
user = current_user
user.add_project(str(project.project.id))
return redirect('/project/%s/'% project.project.id)
return render_template('project_create.html',form=form)
示例8: test_project_create
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def test_project_create():
project = Project()
test_project_name = 'test project db'
test_project_desc = 'test_project_desc'
project.create(test_project_name,test_project_desc)
assert project.project.name == test_project_name
assert project.project.description == test_project_desc
assert project.project.entries == []
db = MongoModel(project='internal',collection='project')
test_data = db.query({'name':test_project_name})
assert test_data['name'] == test_project_name
assert test_data['description'] == test_project_desc
db.delete({'name':test_project_name})
示例9: setup_user_project_list
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_user_project_list():
user = User()
user.create('test_user_list','test_pass','[email protected]')
project = Project()
project.create('project list 1','project content 1')
user.add_project(project.get_id())
project = Project()
project.create('project list 2','project content 2')
user.add_project(project.get_id())
project = Project()
project.create('project list 3','project content 3')
user.add_project(project.get_id())
示例10: setup_test_get
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_test_get():
project = Project()
project.create('scraped','test scraping')
entry_id = project.add_entry('entry','test entry','entry','entry')
model = project.get_entry_collection(entry_id)
model.insert({'a':1})
示例11: setup_project_delete
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_project_delete():
user = User()
user.create('test_user_delete_api_project','test_pass','[email protected]')
project = Project()
project.create('project 1','project content 1')
user.add_project(project.get_id())
示例12: setup_test_project_db
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_test_project_db():
project = Project()
project.create('test project db',' list entries')
project.add_entry('test entries','test data','test_entries','test_data')
示例13: setup_test_project_entries
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_test_project_entries():
project = Project()
project.create('test project entries',' list entries')
示例14: setup_test_project_update
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_test_project_update():
project = Project()
project.create('test project update','updating project')
示例15: setup_test_project_upload
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import create [as 别名]
def setup_test_project_upload():
project = Project()
project.create('test project upload',' list entries')
project.add_entry('test entries','test entries','test_source','test_entries')