本文整理汇总了Python中models.Project.get_all方法的典型用法代码示例。如果您正苦于以下问题:Python Project.get_all方法的具体用法?Python Project.get_all怎么用?Python Project.get_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Project
的用法示例。
在下文中一共展示了Project.get_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: from models import Project [as 别名]
# 或者: from models.Project import get_all [as 别名]
def index():
"""Projects index route.
GET /a
Lists all the projects managed by Sirius.
The page also allows creation of new projects through
a quick entry form.
"""
projects = Project.get_all()
return render_template('projects/index.html', projects=projects)
示例2: _save_clicked
# 需要导入模块: from models import Project [as 别名]
# 或者: from models.Project import get_all [as 别名]
def _save_clicked(self):
interval = self._validate_monkeys()
if not interval:
return
rec = Project([
self.current_rec_id,
self.ui.nicknameEdit.text(),
self.ui.nameEdit.text(),
interval.first_month,
interval.last_month,
self.ui.notesEdit.toPlainText(),
self.ui.billingEdit.toPlainText()
])
try:
rec.save()
except AllocatException as e:
QMessageBox.critical(QMessageBox(), 'Input Error', e.msg)
self.ui.nameEdit.setFocus()
return
Dataset.projects = Project.get_all()
self._load_list(Dataset.projects.keys(), rec.nickname)
self.ui.addBtn.setEnabled(True)