feat(export): sort submissions and optimize query
This commit is contained in:
parent
57317b51d2
commit
d2ca7db7aa
|
@ -1 +1 @@
|
||||||
__version__ = "0.9.0"
|
__version__ = "0.10.0"
|
||||||
|
|
|
@ -397,8 +397,14 @@ class ExportView(EventPermissionRequired, View):
|
||||||
genre_question = request.event.pretalx_musicrate_settings.genre_question
|
genre_question = request.event.pretalx_musicrate_settings.genre_question
|
||||||
origin_question = request.event.pretalx_musicrate_settings.origin_question
|
origin_question = request.event.pretalx_musicrate_settings.origin_question
|
||||||
jurors = request.event.jurors.order_by("token")
|
jurors = request.event.jurors.order_by("token")
|
||||||
for submission in request.event.submissions.prefetch_related("answers").filter(
|
for submission in (
|
||||||
submission_type__in=request.event.pretalx_musicrate_settings.submission_types.all()
|
request.event.submissions.prefetch_related("answers")
|
||||||
|
.select_related("submission_type")
|
||||||
|
.filter(
|
||||||
|
submission_type__in=request.event.pretalx_musicrate_settings.submission_types.all()
|
||||||
|
)
|
||||||
|
.only("title", "submission_type__name")
|
||||||
|
.order_by("created")
|
||||||
):
|
):
|
||||||
submission_info = [submission.title, submission.submission_type.name]
|
submission_info = [submission.title, submission.submission_type.name]
|
||||||
if genre_question is not None:
|
if genre_question is not None:
|
||||||
|
|
Loading…
Reference in New Issue