本文整理匯總了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()