本文整理汇总了Python中mhvdb2.models.Entity.phone方法的典型用法代码示例。如果您正苦于以下问题:Python Entity.phone方法的具体用法?Python Entity.phone怎么用?Python Entity.phone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mhvdb2.models.Entity
的用法示例。
在下文中一共展示了Entity.phone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create
# 需要导入模块: from mhvdb2.models import Entity [as 别名]
# 或者: from mhvdb2.models.Entity import phone [as 别名]
def create(name, email, phone):
entity = Entity()
entity.is_member = False
entity.name = name
entity.email = email
entity.phone = phone
entity.save()
return entity.id
示例2: create
# 需要导入模块: from mhvdb2.models import Entity [as 别名]
# 或者: from mhvdb2.models.Entity import phone [as 别名]
def create(name, email, phone):
member = Entity()
member.is_member = True
member.joined_date = date.today()
member.name = name
member.email = email
member.phone = phone
member.agreement_date = date.today()
return member.save()
示例3: create
# 需要导入模块: from mhvdb2.models import Entity [as 别名]
# 或者: from mhvdb2.models.Entity import phone [as 别名]
def create(name, email, phone, joined_date=None, agreement_date=None):
if joined_date is None:
joined_date = date.today()
if agreement_date is None:
agreement_date = date.today()
member = Entity()
member.is_member = True
member.name = name
member.email = email
member.phone = phone
member.joined_date = joined_date
member.agreement_date = agreement_date
member.save()
return member.id