docx 생성 시 기본정보 표기

This commit is contained in:
peregr1nus
2025-12-12 16:19:45 +09:00
parent a3c8a6d738
commit 2898f8a6cd

View File

@@ -25,6 +25,35 @@ class WordProcessor:
self.cult_questions = cult_questions or [] self.cult_questions = cult_questions or []
# 기본 정보 추출
name = basic_info.get('name', '')
district = basic_info.get('district', '')
cult = basic_info.get('cult', '')
cult_other = basic_info.get('cult_other', '')
# 이단명 결정 (기타 선택 시 직접 입력한 값 사용)
if cult == '기타 (위 선택지에 없을 경우)' and cult_other:
display_cult = cult_other
else:
display_cult = cult
# 문서 맨 위에 기본 정보 표시
title = doc.add_heading('이단 탈퇴자 교리점검표', 0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
info_para = doc.add_paragraph()
info_para.add_run('이름: ').bold = True
info_para.add_run(name if name else '(미입력)')
info_para.add_run(' | ')
info_para.add_run('교구: ').bold = True
info_para.add_run(district if district else '(미입력)')
info_para.add_run(' | ')
info_para.add_run('이단교단: ').bold = True
info_para.add_run(display_cult if display_cult else '(미입력)')
info_para.alignment = WD_ALIGN_PARAGRAPH.CENTER
doc.add_paragraph('') # 빈 줄
# 1. 첫 번째 단락: 별첨 목록 # 1. 첫 번째 단락: 별첨 목록
doc.add_paragraph('*별첨1 : 감리교 신앙고백서 확인점검') doc.add_paragraph('*별첨1 : 감리교 신앙고백서 확인점검')
doc.add_paragraph('*별첨2 : 이단 일반 점검') doc.add_paragraph('*별첨2 : 이단 일반 점검')