本文整理汇总了Python中autonomie.models.company.Company.employees方法的典型用法代码示例。如果您正苦于以下问题:Python Company.employees方法的具体用法?Python Company.employees怎么用?Python Company.employees使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autonomie.models.company.Company
的用法示例。
在下文中一共展示了Company.employees方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: company2
# 需要导入模块: from autonomie.models.company import Company [as 别名]
# 或者: from autonomie.models.company.Company import employees [as 别名]
def company2(dbsession, user):
from autonomie.models.company import Company
company = Company(
name=u"Company 2",
email=u"[email protected]",
)
company.employees = [user]
dbsession.add(company)
dbsession.flush()
user.companies = [company]
user = dbsession.merge(user)
dbsession.flush()
return company
示例2: other_company
# 需要导入模块: from autonomie.models.company import Company [as 别名]
# 或者: from autonomie.models.company.Company import employees [as 别名]
def other_company(dbsession, other_user):
from autonomie.models.company import Company
company = Company(
name=u"Company2",
email=u"[email protected]",
code_compta="0USER2",
)
company.employees = [other_user]
dbsession.add(company)
dbsession.flush()
other_user.companies = [company]
other_user = dbsession.merge(other_user)
dbsession.flush()
return company
示例3: _mk_company
# 需要导入模块: from autonomie.models.company import Company [as 别名]
# 或者: from autonomie.models.company.Company import employees [as 别名]
def _mk_company(name, email, code_compta):
from autonomie.models.company import Company
company = Company(
name=name,
email=email,
code_compta=code_compta,
)
company.employees = [user]
dbsession.add(company)
dbsession.flush()
user.companies = [company]
dbsession.merge(user)
dbsession.flush()
return company