本文整理汇总了Python中models.Record.add_record方法的典型用法代码示例。如果您正苦于以下问题:Python Record.add_record方法的具体用法?Python Record.add_record怎么用?Python Record.add_record使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Record
的用法示例。
在下文中一共展示了Record.add_record方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: commit_request
# 需要导入模块: from models import Record [as 别名]
# 或者: from models.Record import add_record [as 别名]
def commit_request():
"""
API endpoint used by the front-end to commit a new merit request in ther records database
"""
name = request.form['name']
justification = request.form['justification']
pledges = request.form['pledges'].split(',')
suggested_value = request.form['suggestedValue']
now = datetime.date.today()
for pledge_id in pledges:
record_id = Record.add_record(name, now, suggested_value, justification, pledge_id)
return 'Request Successfully Submited'