本文整理匯總了Python中oyProjectManager.models.project.Project.query方法的典型用法代碼示例。如果您正苦於以下問題:Python Project.query方法的具體用法?Python Project.query怎麽用?Python Project.query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類oyProjectManager.models.project.Project
的用法示例。
在下文中一共展示了Project.query方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setup_defaults
# 需要導入模塊: from oyProjectManager.models.project import Project [as 別名]
# 或者: from oyProjectManager.models.project.Project import query [as 別名]
def setup_defaults(self):
"""sets the defaults
"""
# fill the projects
projects = Project.query()\
.filter(Project.active==True)\
.order_by(Project.name)\
.all()
self.projects_comboBox.addItems(
map(lambda x: x.name, projects)
)
self.projects_comboBox.projects = projects
self.projects_comboBox.setCurrentIndex(0)
self.project_changed()
self.fill_assets_tableWidget()
示例2: update_project_comboBox
# 需要導入模塊: from oyProjectManager.models.project import Project [as 別名]
# 或者: from oyProjectManager.models.project.Project import query [as 別名]
def update_project_comboBox(self):
"""Updates the projects_comboBox
"""
# fill projects
projects = Project.query()\
.order_by(Project.name.asc())\
.all()
# cache the projects
self.projects_comboBox.projects = projects
self.projects_comboBox.clear()
#self.projects_comboBox.addItems(map(lambda x: x.name, projects))
for i, project in enumerate(projects):
if project.active:
self.projects_comboBox.addItem(project.name)
else:
self.projects_comboBox.addItem(
QtGui.QIcon(
":/trolltech/styles/commonstyle/images/stop-24.png"
),
project.name
)