当前位置: 首页>>代码示例>>Python>>正文


Python Account._r方法代码示例

本文整理汇总了Python中models.account.Account._r方法的典型用法代码示例。如果您正苦于以下问题:Python Account._r方法的具体用法?Python Account._r怎么用?Python Account._r使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.account.Account的用法示例。


在下文中一共展示了Account._r方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: listActiveAccounts

# 需要导入模块: from models.account import Account [as 别名]
# 或者: from models.account.Account import _r [as 别名]
 def listActiveAccounts(cls):
   from models.account import Account
   
   return Account.query\
     .filter(~Account.status.in_(Account._r(Account.STATUS_DELETED)))\
     .order_by(Account.first_name, Account.last_name, Account.alias)\
     .all()
开发者ID:timur-glushan,项目名称:tt,代码行数:9,代码来源:account.py

示例2: listActiveReports

# 需要导入模块: from models.account import Account [as 别名]
# 或者: from models.account.Account 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()
开发者ID:timur-glushan,项目名称:tt,代码行数:28,代码来源:report.py


注:本文中的models.account.Account._r方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。