Permalink
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (64 sloc) 1.44 KB
metadata:
title: Fill fields with field code
short title: Fill
documentation: "https://docassemble.org/docs/documents.html#template code"
example start: 8
example end: 8
---
modules:
- docassemble.base.util
---
objects:
recipient: Individual
---
question: |
Assembling a document from a PDF
template
subquestion: |
This interview will fill fields in
a PDF template. You can
[download the template] to see what
it looks like.
[download the template]: ${ url_of('letter.pdf') }
field: introduction_shown
---
question: |
To whom shall the letter be sent?
fields:
- First Name: recipient.name.first
- Last Name: recipient.name.last
---
question: |
What is the address of ${ recipient }?
fields:
- Address: recipient.address.address
- Unit: recipient.address.unit
required: False
- City: recipient.address.city
- State: recipient.address.state
code: |
states_list()
- Zip: recipient.address.zip
required: False
---
question: |
What is the subject of the letter?
field: subject_of_letter
choices:
- Sales of oranges in Q4 2016
- Pedantry and pedagogy
- Tulips, tiptoes, and soil erosion
- Breakfast cereals in late antiquity
---
mandatory: true
code: |
introduction_shown
---
mandatory: True
question: Here is your document.
attachment:
pdf template file: letter.pdf
field code:
- letter_date: today()
- subject_line: subject_of_letter
- recipient_address: recipient.address_block()