Я нуб в django / python, я видел код в github об "экспорте файлов Vcard", мой вопрос о том, что программист заменит значение переменной в строковой переменной:
admin.py:
output = ""
for person in queryset.all():
person_output = """BEGIN:VCARD
VERSION:3.0
N:{last_name};{first_name}
FN:{first_name} {last_name}
TEL;TYPE=HOME,VOICE:{phone}
TEL;TYPE=WORK,VOICE:{secondary_phone}
EMAIL:{email}
REV:{rev}
END:VCARD"""
# how can replace value when the source is string?!
person_output = person_output.format(
first_name = person.first_name,
last_name = person.last_name,
phone = person.phone,
secondary_phone = person.secondary_phone,
email = person.email,
rev = d.strftime('%Y%M%d%H%f'),
)
Может кто-нибудь PLZ объяснить, как это возможно, и дайте мне знать любую документацию Python / Django об этом? Спасибо.