-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #837 from SuffolkLITLab/make-pages-odd-or-even
When using the as_pdf() method of a bundle, add parameter to ensure an odd or even number of pages
- Loading branch information
Showing
2 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
docassemble/AssemblyLine/data/questions/test_bundle_parity.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
include: | ||
- assembly_line.yml | ||
--- | ||
objects: | ||
- the_doc: ALDocument.using( | ||
title="The document", | ||
filename="the_document", | ||
enabled=True, | ||
has_addendum=False | ||
) | ||
--- | ||
objects: | ||
- even_bundle: ALDocumentBundle.using( | ||
title="Even bundle", | ||
filename="the_bundle", | ||
elements=[ | ||
the_doc | ||
], | ||
default_parity="even", | ||
enabled=True | ||
) | ||
- odd_bundle: ALDocumentBundle.using( | ||
title="Even bundle", | ||
filename="the_bundle", | ||
elements=[ | ||
the_doc, | ||
the_doc | ||
], | ||
enabled=True | ||
) | ||
- bundle_with_default: ALDocumentBundle.using( | ||
title="Even bundle", | ||
filename="the_bundle", | ||
elements=[ | ||
the_doc | ||
], | ||
default_parity="even", | ||
enabled=True | ||
) | ||
|
||
--- | ||
objects: | ||
- bundle_of_bundles: ALDocumentBundle.using( | ||
title="Bundle of bundles", | ||
filename="the_bundle", | ||
elements=[ | ||
even_bundle, | ||
bundle_with_default | ||
], | ||
enabled=True | ||
) | ||
|
||
--- | ||
attachment: | ||
variable name: the_doc[i] | ||
content: | | ||
Test content | ||
--- | ||
mandatory: True | ||
question: | | ||
About to make a PDF | ||
continue button field: the_field | ||
--- | ||
mandatory: True | ||
question: | | ||
Download | ||
subquestion: | | ||
# Should be even | ||
${ even_bundle.as_pdf(ensure_parity="even") } | ||
# should be odd | ||
${ odd_bundle.as_pdf(ensure_parity="odd") } | ||
# should be even | ||
${ bundle_with_default.as_pdf() } | ||
# Should be even | ||
${ bundle_of_bundles.as_pdf() } |