recover order.py&doc and create vertical_merge.py&doc

This commit is contained in:
Arthas 2017-10-15 10:52:56 +08:00
parent a7348b2dfb
commit 52df98c914
7 changed files with 24 additions and 2 deletions

View File

@ -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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

23
tests/vertical merge.py Normal file
View 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')