def talk_to_dict(talk):
return {
'title': talk.title,
'description': talk.description,
'category': str(talk.category),
'accepted': talk.accepted,
'confirmed': talk.confirmed,
'start_date': talk.start_date.astimezone(tz=pytz.timezone(settings.TIME_ZONE)) if talk.start_date else None,
'duration': talk.estimated_duration,
'track': str(talk.track) if talk.track else '',
'video': talk.video,
'speakers': list(map(speaker_to_dict, talk.speakers.all())),
}
评论列表
文章目录