Changeset 1446 in products for quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/binary.txt
- Timestamp:
- Dec 8, 2009 7:53:25 AM (14 years ago)
- Location:
- quintagroup.transmogrifier/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.transmogrifier/trunk
- Property svn:mergeinfo changed from /quintagroup.transmogrifier/branches/plone-2.1/quintagroup.transmogrifier:1387-1389,1394-1413 to /quintagroup.transmogrifier/branches/plone-2.1/quintagroup.transmogrifier:1387-1389,1394-1413,1426-1444
-
quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/binary.txt
r453 r1446 17 17 section. 18 18 19 Also this section provides condition option which, if specified, exports/imports 20 this or another binary field only if condition expression evaluates to true. 21 19 22 >>> import pprint 20 23 >>> binary = """ … … 32 35 ... [fileexporter] 33 36 ... blueprint = quintagroup.transmogrifier.fileexporter 37 ... condition = python:fname != 'image' 34 38 ... 35 39 ... [dataprinter] … … 58 62 'name': '.file-fields.xml'}}, 59 63 '_path': 'spam/eggs/foo'} 60 <?xml version="1.0" ?>64 <?xml version="1.0" encoding="utf-8"?> 61 65 <manifest> 62 66 <field name="file"> 63 <filename>archive.tar.gz</filename> 64 <mimetype>application/x-tar</mimetype> 67 <filename> 68 archive.tar.gz 69 </filename> 70 <mimetype> 71 application/x-tar 72 </mimetype> 65 73 </field> 66 74 </manifest> … … 70 78 71 79 TODO: write test for getting data for fields from import context 80 81 The ``condition`` expression hass access to the following: 82 83 =================== ========================================================== 84 ``item`` the current pipeline item 85 ``transmogrifier`` the transmogrifier 86 ``name`` the name of the splitter section 87 ``options`` the splitter options 88 ``modules`` sys.modules 89 ``context`` the current content object 90 ``fname`` the name of the field being processed 91 ``filename`` the file name binary field is loaded into (import only) 92 ``data`` data read from the file (import only) 93 ``mimetype`` data mimetype (import only) 94 =================== ==========================================================
Note: See TracChangeset
for help on using the changeset viewer.