Last change
on this file since 1 was
1,
checked in by myroslav, 18 years ago
|
Building directory structure
|
File size:
644 bytes
|
Line | |
---|
1 | ## Script (Python) "isATCTbased" |
---|
2 | ##title=Formats the history diff |
---|
3 | ##bind container=container |
---|
4 | ##bind context=context |
---|
5 | ##bind namespace= |
---|
6 | ##bind script=script |
---|
7 | ##bind subpath=traverse_subpath |
---|
8 | ##parameters=download=0,fields=None,show_header=1 |
---|
9 | if download: |
---|
10 | context.REQUEST.RESPONSE.setHeader('Content-Type', 'plain/text') |
---|
11 | context.REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment; filename="%s.csv"'% context.getId()) |
---|
12 | |
---|
13 | res = context.queryCatalog() |
---|
14 | fields = fields or context.getCustomViewFields() |
---|
15 | csv_data = [] |
---|
16 | for r in res: |
---|
17 | csv_data.append(dict([(f, getattr(r, f, ''))for f in fields])) |
---|
18 | return context.toCSV(fields, csv_data) |
---|
Note: See
TracBrowser
for help on using the repository browser.