本文整理汇总了Python中models.project.Project._r方法的典型用法代码示例。如果您正苦于以下问题:Python Project._r方法的具体用法?Python Project._r怎么用?Python Project._r使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.project.Project
的用法示例。
在下文中一共展示了Project._r方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: listActiveReports
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import _r [as 别名]
def listActiveReports(cls, start_date=None, end_date=None, accounts=None, components=None):
from models.account import Account
from models.project import Project, Component
from models.report import Report
query = Report.query\
.filter(~Report.status.in_(Report._r(Report.STATUS_DELETED)))\
.join(Report.account)\
.filter(~Account.status.in_(Account._r(Account.STATUS_DELETED)))\
.join(Report.component, aliased=True)\
.filter(~Component.status.in_(Component._r(Component.STATUS_DELETED)))\
.join(Report.project, aliased=True)\
.filter(~Project.status.in_(Project._r(Project.STATUS_DELETED)))
if start_date:
query = query.filter(Report.due_date>=start_date)
if end_date:
query = query.filter(Report.due_date<=end_date)
if accounts:
query = query.filter(Report.account_id.in_(accounts))
if components:
query = query.filter(Report.component_id.in_(components))
query = query.order_by(Account.first_name, Account.last_name, Account.alias, Report.due_date, Report.created)
return query.all()
示例2: listActiveProjects
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import _r [as 别名]
def listActiveProjects(cls):
from models.project import Project, Label
return Project.query\
.join(Project.labels)\
.filter(~Project.status.in_(Project._r(Project.STATUS_DELETED)))\
.order_by(Label.title, Project.alias)\
.all()
示例3: listAllActiveComponents
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import _r [as 别名]
def listAllActiveComponents(cls):
from models.project import Project, Component, Label
return Component.query\
.join(Component.project)\
.join(Project.labels)\
.join(Project.members, aliased=True)\
.filter(~Component.status.in_(Component._r(Component.STATUS_DELETED)))\
.filter(~Project.status.in_(Project._r(Project.STATUS_DELETED)))\
.order_by(Label.title, Project.alias, Component.alias)\
.all()
示例4: listProjectsForActiveMember
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import _r [as 别名]
def listProjectsForActiveMember(cls, account):
from models.project import Project, Membership
account = cls.__parseAccountArgument(account)
return Project.query\
.filter(~Project.status.in_(Project._r(Project.STATUS_DELETED)))\
.join(Project.members, aliased=True)\
.filter(Membership.account==account, ~Membership.status.in_(Membership._r(Membership.STATUS_DELETED)))\
.order_by(Project.alias)\
.all() + cls.listGeneralProjects()
示例5: listComponentsForActiveMember
# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import _r [as 别名]
def listComponentsForActiveMember(cls, project, account):
from models.project import Project, Component, Membership
project = cls.__parseProjectArgument(project)
account = cls.__parseAccountArgument(account)
return Component.query\
.filter(Component.project_id==project.id, ~Component.status.in_(Component._r(Component.STATUS_DELETED)))\
.join(Component.project)\
.filter(~Project.status.in_(Project._r(Project.STATUS_DELETED)))\
.join(Project.members, aliased=True)\
.filter(Membership.account==account, ~Membership.status.in_(Membership._r(Membership.STATUS_DELETED)))\
.order_by(Project.alias, Component.alias)\
.all()