recover order.py&doc and create vertical_merge.py&doc
This commit is contained in:
parent
a7348b2dfb
commit
52df98c914
@ -19,8 +19,7 @@ context = {
|
||||
'in_europe' : True,
|
||||
'is_paid': False,
|
||||
'company_name' : 'The World Wide company',
|
||||
'total_price' : '100,000,000.00',
|
||||
'category' : 'BOOK'
|
||||
'total_price' : '100,000,000.00'
|
||||
}
|
||||
|
||||
tpl.render(context)
|
||||
|
||||
BIN
tests/test_files/.DS_Store
vendored
Normal file
BIN
tests/test_files/.DS_Store
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tests/test_files/vertical_merge.docx
Normal file
BIN
tests/test_files/vertical_merge.docx
Normal file
Binary file not shown.
BIN
tests/test_files/vertical_merge_tpl.docx
Normal file
BIN
tests/test_files/vertical_merge_tpl.docx
Normal file
Binary file not shown.
23
tests/vertical merge.py
Normal file
23
tests/vertical merge.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Created : 2017-10-15
|
||||
|
||||
@author: Arthaslixin
|
||||
'''
|
||||
|
||||
from docxtpl import DocxTemplate
|
||||
|
||||
tpl=DocxTemplate('test_files/vertical_merge_tpl.docx')
|
||||
|
||||
context = {
|
||||
'items' : [
|
||||
{'desc' : 'Python interpreters', 'qty' : 2, 'price' : 'FREE' },
|
||||
{'desc' : 'Django projects', 'qty' : 5403, 'price' : 'FREE' },
|
||||
{'desc' : 'Guido', 'qty' : 1, 'price' : '100,000,000.00' },
|
||||
],
|
||||
'total_price' : '100,000,000.00',
|
||||
'category' : 'Book'
|
||||
}
|
||||
|
||||
tpl.render(context)
|
||||
tpl.save('test_files/vertical_merge.docx')
|
||||
Loading…
x
Reference in New Issue
Block a user