本文整理汇总了Python中coredata.models.Unit.set_deptid方法的典型用法代码示例。如果您正苦于以下问题:Python Unit.set_deptid方法的具体用法?Python Unit.set_deptid怎么用?Python Unit.set_deptid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coredata.models.Unit
的用法示例。
在下文中一共展示了Unit.set_deptid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_units
# 需要导入模块: from coredata.models import Unit [as 别名]
# 或者: from coredata.models.Unit import set_deptid [as 别名]
def create_units():
univ, _ = Unit.objects.get_or_create(label='UNIV', name='Simon Fraser University')
fas = Unit(label='FAS', name='Faculty of Applied Sciences', parent=univ).save()
ensc = Unit(label='ENSC', name='School of Engineering Science', parent=fas, acad_org='ENG SCI').save()
cmpt = Unit(label='CMPT', name='School of Computing Science', parent=fas, acad_org='COMP SCI')
cmpt.set_address(['9971 Applied Sciences Building', '8888 University Drive, Burnaby, BC', 'Canada V5A 1S6'])
cmpt.set_email('[email protected]')
cmpt.set_web('http://www.cs.sfu.ca/')
cmpt.set_tel('778-782-4277')
cmpt.set_fax('778-782-3045')
cmpt.set_informal_name('Computing Science')
cmpt.config['sessional_pay'] = 10000
cmpt.set_deptid('12345')
cmpt.save()
示例2: create_units
# 需要导入模块: from coredata.models import Unit [as 别名]
# 或者: from coredata.models.Unit import set_deptid [as 别名]
def create_units():
univ = Unit.objects.get(slug='univ')
fas = Unit(label='FAS', name='Faculty of Applied Sciences', parent=univ)
fas.save()
ensc = Unit(label='ENSC', name='School of Engineering Science', parent=fas, acad_org='ENG SCI')
ensc.save()
mse = Unit(label='MSE', name='School of Mechatronic Systems Engineering', parent=fas, acad_org='MECH SYS')
mse.save()
cmpt = Unit(label='CMPT', name='School of Computing Science', parent=fas, acad_org='COMP SCI')
cmpt.set_address(['9971 Applied Sciences Building', '8888 University Drive, Burnaby, BC', 'Canada V5A 1S6'])
cmpt.set_email('[email protected]')
cmpt.set_web('http://www.cs.sfu.ca/')
cmpt.set_tel('778-782-4277')
cmpt.set_fax('778-782-3045')
cmpt.set_informal_name('Computing Science')
cmpt.set_deptid('12345')
cmpt.save()