0001-remove-inefficient-json.loads-json.dumps-in-listing-.patch
wcs/backoffice/management.py | ||
---|---|---|
865 | 865 |
selected_filter, user=user, query=query, criterias=criterias, |
866 | 866 |
order_by=order_by) |
867 | 867 |
if get_request().form.get('full') == 'on': |
868 |
output = [json.loads(filled.export_to_json(include_files=False)) for filled in items]
|
|
868 |
output = [filled.get_json_export_dict(include_files=False) for filled in items]
|
|
869 | 869 |
else: |
870 | 870 |
output = [{'id': filled.id, |
871 | 871 |
'url': filled.get_url(), |
wcs/formdata.py | ||
---|---|---|
545 | 545 |
evo.parts = None |
546 | 546 |
self.store() |
547 | 547 | |
548 |
def export_to_json(self, include_files=True):
|
|
548 |
def get_json_export_dict(self, include_files=True):
|
|
549 | 549 |
data = {} |
550 | 550 |
data['id'] = '%s/%s' % (self.formdef.url_name, self.id) |
551 | 551 |
data['display_id'] = self.get_display_id() |
... | ... | |
581 | 581 |
if self.workflow_data: |
582 | 582 |
data['workflow']['data'] = self.workflow_data |
583 | 583 | |
584 |
return data |
|
585 | ||
586 |
def export_to_json(self, include_files=True): |
|
587 |
data = self.get_json_export_dict(include_files=include_files) |
|
584 | 588 |
return json.dumps(data, |
585 | 589 |
cls=qommon.misc.JSONEncoder, |
586 | 590 |
encoding=get_publisher().site_charset) |
587 |
- |