本文整理匯總了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)