本文整理汇总了Python中corehq.apps.commtrack.models.Program.name方法的典型用法代码示例。如果您正苦于以下问题:Python Program.name方法的具体用法?Python Program.name怎么用?Python Program.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.commtrack.models.Program
的用法示例。
在下文中一共展示了Program.name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_program
# 需要导入模块: from corehq.apps.commtrack.models import Program [as 别名]
# 或者: from corehq.apps.commtrack.models.Program import name [as 别名]
def make_program(domain, name, code):
p = Program()
p.domain = domain
p.name = name
p.code = code.lower()
p.save()
return p
示例2: make_program
# 需要导入模块: from corehq.apps.commtrack.models import Program [as 别名]
# 或者: from corehq.apps.commtrack.models.Program import name [as 别名]
def make_program(domain, name, code, default=False):
p = Program()
p.domain = domain
p.name = name
p.code = code.lower()
p.default = default
p.save()
return p
示例3: sync_openlmis_program
# 需要导入模块: from corehq.apps.commtrack.models import Program [as 别名]
# 或者: from corehq.apps.commtrack.models.Program import name [as 别名]
def sync_openlmis_program(domain, lmis_program):
program = get_program(domain, lmis_program)
if program is None:
program = Program(domain=domain)
program.name = lmis_program.name
program.code = lmis_program.code.lower()
program._doc_type_attr = "Program"
program.save()
if lmis_program.products:
for lmis_product in lmis_program.products:
sync_openlmis_product(domain, program, lmis_product)
return program
示例4: sync_openlmis_program
# 需要导入模块: from corehq.apps.commtrack.models import Program [as 别名]
# 或者: from corehq.apps.commtrack.models.Program import name [as 别名]
def sync_openlmis_program(domain, lmis_program):
program = get_program(domain, lmis_program)
if program is None:
program = Program(domain=domain)
else:
# currently impossible
raise NotImplementedError('updating existing programs is not yet supported')
program.name = lmis_program.name
program.code = lmis_program.code
program.save()
if lmis_program.products:
for lmis_product in lmis_program.products:
sync_openlmis_product(domain, program, lmis_product)
return program