Revision cd1915aa snf-astakos-app/astakos/im/management/commands/project-list.py
b/snf-astakos-app/astakos/im/management/commands/project-list.py | ||
---|---|---|
53 | 53 |
dest='skip', |
54 | 54 |
default=False, |
55 | 55 |
help="Skip cancelled and terminated projects"), |
56 |
make_option('--full', |
|
57 |
action='store_true', |
|
58 |
dest='full', |
|
59 |
default=False, |
|
60 |
help="Do not shorten long names"), |
|
56 | 61 |
) |
57 | 62 |
|
58 | 63 |
def handle_noargs(self, **options): |
59 |
labels = ('ProjID', 'Name', 'Owner', 'Status', 'AppID')
|
|
60 |
columns = (7, 23, 23, 20, 7)
|
|
64 |
labels = ('ProjID', 'Name', 'Applicant', 'Email', 'Status', 'AppID')
|
|
65 |
columns = (7, 23, 20, 20, 17, 7)
|
|
61 | 66 |
|
62 | 67 |
if not options['csv']: |
63 | 68 |
line = ' '.join(l.rjust(w) for l, w in zip(labels, columns)) |
... | ... | |
69 | 74 |
if options['skip']: |
70 | 75 |
chain_dict = do_skip(chain_dict) |
71 | 76 |
|
77 |
allow_shorten = not options['full'] |
|
78 |
|
|
72 | 79 |
for info in chain_info(chain_dict): |
73 | 80 |
|
74 | 81 |
fields = [ |
75 | 82 |
(info['projectid'], False), |
76 | 83 |
(info['name'], True), |
77 |
(info['owner'], True), |
|
84 |
(info['applicant'], True), |
|
85 |
(info['email'], True), |
|
78 | 86 |
(info['status'], False), |
79 | 87 |
(info['appid'], False), |
80 | 88 |
] |
... | ... | |
86 | 94 |
else: |
87 | 95 |
output = [] |
88 | 96 |
for (field, shorten), width in zip(fields, columns): |
89 |
s = shortened(field, width) if shorten else field |
|
97 |
s = (shortened(field, width) if shorten and allow_shorten |
|
98 |
else field) |
|
90 | 99 |
s = s.rjust(width) |
91 | 100 |
output.append(s) |
92 | 101 |
|
... | ... | |
113 | 122 |
d = { |
114 | 123 |
'projectid' : str(chain), |
115 | 124 |
'name' : str(project.application.name if project else app.name), |
116 |
'owner' : app.owner.realname, |
|
125 |
'applicant' : app.applicant.realname, |
|
126 |
'email' : app.applicant.email, |
|
117 | 127 |
'status': status, |
118 | 128 |
'appid' : appid, |
119 | 129 |
} |
Also available in: Unified diff