def parse_individual_questions(self, parent_object):
styNormal = styleSheet['Normal']
styBackground = ParagraphStyle('background', parent=styNormal, backColor=colors.white)
answer=self.main_answer
for first_children in parent_object:
if first_children['type'] == "repeat":
self.parse_repeat(first_children)
elif first_children['type'] == 'group':
self.parse_group(first_children)
else:
question = first_children['name']
if first_children['type'] == 'note' or question not in self.main_answer:
answer= Paragraph('', styBackground)
elif first_children['type'] == 'photo':
photo = 'http://'+self.base_url+'/media/'+ self.media_folder +'/attachments/'+self.main_answer[question]
answer = self.create_logo(photo)
else:
answer = Paragraph(self.main_answer[question], styBackground)
if 'label' in first_children:
question = first_children['label']
row=(Paragraph(question, styBackground), answer)
self.data.append(row)
评论列表
文章目录