當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。