当前位置: 首页>>代码示例>>Python>>正文


Python Project.create方法代码示例

本文整理汇总了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)
开发者ID:sweemeng,项目名称:scrapedump,代码行数:9,代码来源:test_project.py

示例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())
开发者ID:sweemeng,项目名称:scrapedump,代码行数:9,代码来源:test_api.py

示例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')
开发者ID:sweemeng,项目名称:scrapedump,代码行数:9,代码来源:test_project_frontend.py

示例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())
开发者ID:sweemeng,项目名称:scrapedump,代码行数:11,代码来源:test_api.py

示例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())
开发者ID:sweemeng,项目名称:scrapedump,代码行数:11,代码来源:test_project_api.py

示例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])    
开发者ID:sweemeng,项目名称:scrapedump,代码行数:11,代码来源:test_project_api.py

示例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)
开发者ID:sweemeng,项目名称:scrapedump,代码行数:14,代码来源:action.py

示例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})
开发者ID:sweemeng,项目名称:scrapedump,代码行数:15,代码来源:test_project.py

示例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())
开发者ID:sweemeng,项目名称:scrapedump,代码行数:14,代码来源:test_project_api.py

示例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})
开发者ID:sweemeng,项目名称:scrapedump,代码行数:8,代码来源:test_api.py

示例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())
开发者ID:sweemeng,项目名称:scrapedump,代码行数:8,代码来源:test_project_api.py

示例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')
开发者ID:sweemeng,项目名称:scrapedump,代码行数:6,代码来源:test_project.py

示例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')
开发者ID:sweemeng,项目名称:scrapedump,代码行数:5,代码来源:test_project.py

示例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')
开发者ID:sweemeng,项目名称:scrapedump,代码行数:5,代码来源:test_project.py

示例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')
开发者ID:sweemeng,项目名称:scrapedump,代码行数:6,代码来源:test_project.py


注:本文中的project.model.Project.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。