本文整理汇总了Python中autonomie.models.company.Company.name方法的典型用法代码示例。如果您正苦于以下问题:Python Company.name方法的具体用法?Python Company.name怎么用?Python Company.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autonomie.models.company.Company
的用法示例。
在下文中一共展示了Company.name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_company
# 需要导入模块: from autonomie.models.company import Company [as 别名]
# 或者: from autonomie.models.company.Company import name [as 别名]
def add_company(self, name, user):
"""
Add a company 'name' in the database
( set its goal by default )
"""
log.info(u"Adding company : %s" % name)
company = Company()
company.name = name
company.goal = u"Entreprise de {0}".format(format_account(user))
company.contribution = self.request.config.get('contribution_cae')
company = self.dbsession.merge(company)
self.dbsession.flush()
return company
示例2: add_company
# 需要导入模块: from autonomie.models.company import Company [as 别名]
# 或者: from autonomie.models.company.Company import name [as 别名]
def add_company(user, company_name, goal=""):
company = Company()
company.name = company_name
company.goal = goal or u"Entreprise de %s" % user.login
user.companies.append(company)
session = DBSESSION()
session.add(company)
session.flush()
print "Added company for %s: %s" % (user.login, company_name)
return company