mirror of
https://github.com/pretix/pretix.git
synced 2026-05-18 17:24:03 +00:00
list ops comma-separated in export
This commit is contained in:
@@ -65,28 +65,16 @@ class ReusableMediaExporter(OrganizerLevelExportMixin, ListExporter):
|
|||||||
yield self.ProgressSetTotal(total=media.count())
|
yield self.ProgressSetTotal(total=media.count())
|
||||||
|
|
||||||
for medium in media.iterator(chunk_size=1000):
|
for medium in media.iterator(chunk_size=1000):
|
||||||
for op in medium.linked_orderpositions:
|
yield [
|
||||||
yield [
|
medium.type,
|
||||||
medium.type,
|
medium.identifier,
|
||||||
medium.identifier,
|
_('Yes') if medium.active else _('No'),
|
||||||
_('Yes') if medium.active else _('No'),
|
date_format(medium.expires, 'SHORT_DATETIME_FORMAT') if medium.expires else '',
|
||||||
date_format(medium.expires, 'SHORT_DATETIME_FORMAT') if medium.expires else '',
|
medium.customer.identifier if medium.customer_id else '',
|
||||||
medium.customer.identifier if medium.customer_id else '',
|
', '.join([f"{op.order.code}-{op.positionid}" for op in medium.linked_orderpositions.all()]),
|
||||||
f"{op.order.code}-{op.positionid}",
|
medium.linked_giftcard.secret if medium.linked_giftcard_id else '',
|
||||||
medium.linked_giftcard.secret if medium.linked_giftcard_id else '',
|
medium.notes,
|
||||||
medium.notes,
|
]
|
||||||
]
|
|
||||||
else:
|
|
||||||
yield [
|
|
||||||
medium.type,
|
|
||||||
medium.identifier,
|
|
||||||
_('Yes') if medium.active else _('No'),
|
|
||||||
date_format(medium.expires, 'SHORT_DATETIME_FORMAT') if medium.expires else '',
|
|
||||||
medium.customer.identifier if medium.customer_id else '',
|
|
||||||
'',
|
|
||||||
medium.linked_giftcard.secret if medium.linked_giftcard_id else '',
|
|
||||||
medium.notes,
|
|
||||||
]
|
|
||||||
|
|
||||||
def get_filename(self):
|
def get_filename(self):
|
||||||
return f'{self.organizer.slug}_media'
|
return f'{self.organizer.slug}_media'
|
||||||
|
|||||||
Reference in New Issue
Block a user