本文整理汇总了Python中project.model.Project.add_entry方法的典型用法代码示例。如果您正苦于以下问题:Python Project.add_entry方法的具体用法?Python Project.add_entry怎么用?Python Project.add_entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project.model.Project
的用法示例。
在下文中一共展示了Project.add_entry方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_user
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [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())
示例2: setup_project_update
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [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')
示例3: setup_test_update
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [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())
示例4: add_entry
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [as 别名]
def add_entry(project_id):
form = EntryForm(csrf_enabled=False)
if form.validate_on_submit():
project = Project()
project.get(project_id)
name = form.name.data
description = form.description.data
short_name = form.description.data
source = form.description.data
project.add_entry(name,description,source)
return redirect('/project/%s' % project_id)
return render_template('entry_create.html',form=form)
示例5: setup_test_load_data
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [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)
示例6: test_project_entries
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [as 别名]
def test_project_entries():
project = Project()
project.find('test project entries')
# add_entries now should have a description and name file
# there should be a short name field, for field name
# We should have a source
entry_id = project.add_entry('test entries','test data','test_entries','test_entries')
db = MongoModel(project='internal',collection='project')
temp = db.query({'name':'test project entries'})
assert entry_id in temp['stats']
示例7: project_entry_create
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [as 别名]
def project_entry_create(project_id):
form = EntryForm(csrf_enabled=False)
edit = False
project = Project()
project.get(project_id)
permission = EditProjectPermission(project_id)
if not permission.can():
abort(403)
if form.validate_on_submit():
name = form.name.data
description = form.description.data
source = form.source.data
entry_id = project.add_entry(name,description,source)
return redirect('/project/%s/' % (project_id))
return render_template('entry_create.html',form=form)
示例8: setup_test_get
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [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})
示例9: setup_test_project_db
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [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')
示例10: setup_test_project_upload
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [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')
示例11: setup_project_view
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import add_entry [as 别名]
def setup_project_view():
project = Project()
project.create('project view','test project view')
project.add_entry('data','test data','data')