3887 |
3887 |
return
|
3888 |
3888 |
|
3889 |
3889 |
formdatas = formdef.data_class().get_ids(item_ids, order_by='receipt_time')
|
3890 |
|
self.completion_status = f'0/{len(formdatas)}'
|
|
3890 |
total_count = len(formdatas)
|
|
3891 |
self.completion_status = f'0/{total_count} (0%)'
|
3891 |
3892 |
self.store()
|
3892 |
3893 |
|
3893 |
3894 |
publisher = get_publisher()
|
... | ... | |
3903 |
3904 |
{
|
3904 |
3905 |
'oldest_form': oldest_lazy_form,
|
3905 |
3906 |
'mass_action_index': i,
|
3906 |
|
'mass_action_length': len(formdatas),
|
|
3907 |
'mass_action_length': total_count,
|
3907 |
3908 |
}
|
3908 |
3909 |
)
|
3909 |
3910 |
if getattr(action['action'], 'status_action', False):
|
... | ... | |
3914 |
3915 |
else:
|
3915 |
3916 |
# global action
|
3916 |
3917 |
formdata.perform_global_action(action['action'].id, user)
|
3917 |
|
self.completion_status = f'{i + 1}/{len(formdatas)}'
|
|
3918 |
percent = int((i + 1) * 100 / total_count)
|
|
3919 |
self.completion_status = f'{i + 1}/{total_count} ({percent}%)'
|
3918 |
3920 |
self.store()
|
3919 |
3921 |
|
3920 |
3922 |
def done_action_url(self):
|
... | ... | |
3963 |
3965 |
items, total_count = FormDefUI(formdef).get_listing_items(
|
3964 |
3966 |
fields, selected_filter, user=user, query=query, criterias=criterias, order_by=order_by
|
3965 |
3967 |
)
|
|
3968 |
self.completion_status = f'0/{total_count} (0%)'
|
|
3969 |
self.store()
|
3966 |
3970 |
|
3967 |
3971 |
return self.create_export(formdef, fields, items, total_count)
|
3968 |
3972 |
|
... | ... | |
3973 |
3977 |
if not self.kwargs.get('skip_header_line'):
|
3974 |
3978 |
csv_output.writerow(self.csv_tuple_heading(fields))
|
3975 |
3979 |
|
3976 |
|
for filled in items:
|
|
3980 |
for i, filled in enumerate(items):
|
3977 |
3981 |
csv_output.writerow(tuple(x['value'] for x in self.get_spreadsheet_line(fields, filled)))
|
|
3982 |
percent = int((i + 1) * 100 / total_count)
|
|
3983 |
self.completion_status = f'{i + 1}/{total_count} ({percent}%)'
|
|
3984 |
self.store()
|
3978 |
3985 |
|
3979 |
3986 |
self.file_content = output.getvalue()
|
3980 |
3987 |
self.content_type = 'text/csv'
|
... | ... | |
4018 |
4025 |
data_field=item['field'],
|
4019 |
4026 |
native_value=item['native_value'],
|
4020 |
4027 |
)
|
|
4028 |
percent = int((i + 1) * 100 / total_count)
|
|
4029 |
self.completion_status = f'{i + 1}/{total_count} ({percent}%)'
|
|
4030 |
self.store()
|
4021 |
4031 |
|
4022 |
4032 |
output = io.BytesIO()
|
4023 |
4033 |
workbook.save(output)
|
4024 |
|
-
|