本文整理汇总了Python中people.models.Person.web方法的典型用法代码示例。如果您正苦于以下问题:Python Person.web方法的具体用法?Python Person.web怎么用?Python Person.web使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类people.models.Person
的用法示例。
在下文中一共展示了Person.web方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: log
# 需要导入模块: from people.models import Person [as 别名]
# 或者: from people.models.Person import web [as 别名]
dates = production['dates']
for d in dates:
start_date, end_date = d[0]
place = d[1]
location = theatres[place]
log(' %s %s %s' % (start_date, end_date, location))
if not dry_run():
ProductionPlace.objects.get_or_create(production=production_obj, place=location, start_date=start_date, end_date=end_date)
cast = production['cast']
for name in cast:
m = re.match('(.*) (.*?)$', name)
if m:
first_name, last_name = m.group(1), m.group(2)
else:
first_name, last_name = u'', name
log(' Actor: ' + first_name + ' ' + last_name)
if not dry_run():
try:
person, created = Person.objects.get_or_create(first_name=first_name, last_name=last_name)
except:
person = Person(first_name=first_name, last_name=last_name)
person.save()
Part.objects.get_or_create(production=production_obj, person=person, cast=True)
if name in castLinks:
person.web = castLinks[name]
person.save()