Skip to content

Commit

Permalink
Merge pull request #440 from collective/saved-data-batch-size
Browse files Browse the repository at this point in the history
Use batching on the saved data page.
  • Loading branch information
mauritsvanrees authored Dec 13, 2024
2 parents 4bbeeeb + 4099fc9 commit c62790b
Show file tree
Hide file tree
Showing 15 changed files with 238 additions and 62 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ Changelog
4.2.2 (unreleased)
------------------

- Use batching on the saved data page.
[maurits]

- Pin version `Products.validation>=3.0.0`
[petschki]

- Add a checkbox to disable autofocus on the first input
[yurj]

Expand Down
3 changes: 3 additions & 0 deletions src/collective/easyform/browser/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def view_schema(self):
if ExtraData:
return field.Fields(IExtraData).select(*ExtraData)


def get_items(self):
return [
(key, DataWrapper(key, value, self.context))
Expand Down Expand Up @@ -200,6 +201,8 @@ def __call__(self):
else:
self.context.field.download(self.request.response)
return u""
if hasattr(self.context.field, 'BatchSize'):
self.form_instance.batch_size = self.context.field.BatchSize
return super(SavedDataFormWrapper, self).__call__()


Expand Down
10 changes: 10 additions & 0 deletions src/collective/easyform/interfaces/savedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,13 @@ class ISaveData(IAction):
default=True,
required=False,
)
BatchSize = zope.schema.Int(
title=_(u"label_batch_size", default=u"Batch size"),
description=_(
u"batch_size_text",
default=u"Define a batch size. Leave blank or set to 0 to disable batching in @@data view.",
),
default=10,
min=0,
required=False,
)
20 changes: 15 additions & 5 deletions src/collective/easyform/locales/collective.easyform.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-12-09 14:39+0000\n"
"POT-Creation-Date: 2024-12-13 10:36+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -33,7 +33,7 @@ msgstr ""
msgid "Actions Model"
msgstr ""

#: ./collective/easyform/browser/actions.py:292
#: ./collective/easyform/browser/actions.py:295
msgid "Add new action"
msgstr ""

Expand Down Expand Up @@ -68,7 +68,7 @@ msgstr ""
msgid "Choose an adapter."
msgstr ""

#: ./collective/easyform/browser/actions.py:175
#: ./collective/easyform/browser/actions.py:176
msgid "Clear all"
msgstr ""

Expand Down Expand Up @@ -96,11 +96,11 @@ msgstr ""
msgid "EasyForm"
msgstr ""

#: ./collective/easyform/browser/actions.py:355
#: ./collective/easyform/browser/actions.py:358
msgid "Edit Action '${fieldname}'"
msgstr ""

#: ./collective/easyform/browser/actions.py:360
#: ./collective/easyform/browser/actions.py:363
msgid "Edit XML Actions Model"
msgstr ""

Expand Down Expand Up @@ -263,6 +263,11 @@ msgstr ""
msgid "Your E-Mail Address"
msgstr ""

#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view."
#: ./collective/easyform/interfaces/savedata.py:96
msgid "batch_size_text"
msgstr ""

#. Default: "Reset"
#: ./collective/easyform/interfaces/easyform.py:34
msgid "default_resetLabel"
Expand Down Expand Up @@ -634,6 +639,11 @@ msgstr ""
msgid "label_autofocus"
msgstr ""

#. Default: "Batch size"
#: ./collective/easyform/interfaces/savedata.py:95
msgid "label_batch_size"
msgstr ""

#. Default: "BCC Expression"
#: ./collective/easyform/interfaces/mailer.py:497
msgid "label_bcc_override_text"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: collective.easyform\n"
"POT-Creation-Date: 2024-12-09 14:39+0000\n"
"POT-Creation-Date: 2024-12-13 10:36+0000\n"
"PO-Revision-Date: 2017-01-20 09:48+0000\n"
"Last-Translator: Johannes Raggam <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -32,7 +32,7 @@ msgstr "Art der Aktion"
msgid "Actions Model"
msgstr "Aktionsmodell"

#: ./collective/easyform/browser/actions.py:292
#: ./collective/easyform/browser/actions.py:295
msgid "Add new action"
msgstr "Eine neue Aktion hinzufügen"

Expand Down Expand Up @@ -67,7 +67,7 @@ msgstr "Das CSV Trennzeichen muss angegeben werden."
msgid "Choose an adapter."
msgstr "Wählen Sie einen Adapter aus."

#: ./collective/easyform/browser/actions.py:175
#: ./collective/easyform/browser/actions.py:176
msgid "Clear all"
msgstr "Alles löschen"

Expand Down Expand Up @@ -95,11 +95,11 @@ msgstr ""
msgid "EasyForm"
msgstr "EasyForm"

#: ./collective/easyform/browser/actions.py:355
#: ./collective/easyform/browser/actions.py:358
msgid "Edit Action '${fieldname}'"
msgstr "Aktion '${fieldname}' bearbeiten"

#: ./collective/easyform/browser/actions.py:360
#: ./collective/easyform/browser/actions.py:363
msgid "Edit XML Actions Model"
msgstr "XML Aktionsmodell bearbeiten"

Expand Down Expand Up @@ -262,6 +262,11 @@ msgstr ""
msgid "Your E-Mail Address"
msgstr ""

#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view."
#: ./collective/easyform/interfaces/savedata.py:96
msgid "batch_size_text"
msgstr ""

#. Default: "Reset"
#: ./collective/easyform/interfaces/easyform.py:34
msgid "default_resetLabel"
Expand Down Expand Up @@ -633,6 +638,11 @@ msgstr "Script zum Formular Setup"
msgid "label_autofocus"
msgstr ""

#. Default: "Batch size"
#: ./collective/easyform/interfaces/savedata.py:95
msgid "label_batch_size"
msgstr ""

#. Default: "BCC Expression"
#: ./collective/easyform/interfaces/mailer.py:497
msgid "label_bcc_override_text"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-12-09 14:39+0000\n"
"POT-Creation-Date: 2024-12-13 10:36+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -30,7 +30,7 @@ msgstr ""
msgid "Actions Model"
msgstr ""

#: ./collective/easyform/browser/actions.py:292
#: ./collective/easyform/browser/actions.py:295
msgid "Add new action"
msgstr ""

Expand Down Expand Up @@ -65,7 +65,7 @@ msgstr ""
msgid "Choose an adapter."
msgstr ""

#: ./collective/easyform/browser/actions.py:175
#: ./collective/easyform/browser/actions.py:176
msgid "Clear all"
msgstr ""

Expand Down Expand Up @@ -93,11 +93,11 @@ msgstr ""
msgid "EasyForm"
msgstr ""

#: ./collective/easyform/browser/actions.py:355
#: ./collective/easyform/browser/actions.py:358
msgid "Edit Action '${fieldname}'"
msgstr ""

#: ./collective/easyform/browser/actions.py:360
#: ./collective/easyform/browser/actions.py:363
msgid "Edit XML Actions Model"
msgstr ""

Expand Down Expand Up @@ -260,6 +260,11 @@ msgstr ""
msgid "Your E-Mail Address"
msgstr ""

#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view."
#: ./collective/easyform/interfaces/savedata.py:96
msgid "batch_size_text"
msgstr ""

#. Default: "Reset"
#: ./collective/easyform/interfaces/easyform.py:34
msgid "default_resetLabel"
Expand Down Expand Up @@ -631,6 +636,11 @@ msgstr ""
msgid "label_autofocus"
msgstr "Autofocus"

#. Default: "Batch size"
#: ./collective/easyform/interfaces/savedata.py:95
msgid "label_batch_size"
msgstr ""

#. Default: "BCC Expression"
#: ./collective/easyform/interfaces/mailer.py:497
msgid "label_bcc_override_text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2024-12-09 14:39+0000\n"
"POT-Creation-Date: 2024-12-13 10:36+0000\n"
"PO-Revision-Date: 2023-02-13 03:30-0400\n"
"Last-Translator: Leonardo J. Caballero G. <[email protected]>\n"
"Language-Team: ES <[email protected]>\n"
Expand Down Expand Up @@ -36,7 +36,7 @@ msgstr "Tipo de Acción"
msgid "Actions Model"
msgstr "Modelo de Acción"

#: ./collective/easyform/browser/actions.py:292
#: ./collective/easyform/browser/actions.py:295
msgid "Add new action"
msgstr "Añadir nueva acción"

Expand Down Expand Up @@ -71,7 +71,7 @@ msgstr "El delimitador CSV es obligatorio."
msgid "Choose an adapter."
msgstr "Elige un adaptador."

#: ./collective/easyform/browser/actions.py:175
#: ./collective/easyform/browser/actions.py:176
msgid "Clear all"
msgstr "Limpiar"

Expand Down Expand Up @@ -99,11 +99,11 @@ msgstr "Entrada de formulario de correos electrónicos"
msgid "EasyForm"
msgstr "EasyForm"

#: ./collective/easyform/browser/actions.py:355
#: ./collective/easyform/browser/actions.py:358
msgid "Edit Action '${fieldname}'"
msgstr "Editar acción '${fieldname}'"

#: ./collective/easyform/browser/actions.py:360
#: ./collective/easyform/browser/actions.py:363
msgid "Edit XML Actions Model"
msgstr "Editar XML de Modelo de Acción"

Expand Down Expand Up @@ -266,6 +266,11 @@ msgstr "Vista"
msgid "Your E-Mail Address"
msgstr "Su dirección de correo electrónico"

#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view."
#: ./collective/easyform/interfaces/savedata.py:96
msgid "batch_size_text"
msgstr ""

#. Default: "Reset"
#: ./collective/easyform/interfaces/easyform.py:34
msgid "default_resetLabel"
Expand Down Expand Up @@ -638,6 +643,11 @@ msgstr "Script de preparación del formulario"
msgid "label_autofocus"
msgstr ""

#. Default: "Batch size"
#: ./collective/easyform/interfaces/savedata.py:95
msgid "label_batch_size"
msgstr ""

#. Default: "BCC Expression"
#: ./collective/easyform/interfaces/mailer.py:497
msgid "label_bcc_override_text"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2024-12-09 14:39+0000\n"
"POT-Creation-Date: 2024-12-13 10:36+0000\n"
"PO-Revision-Date: 2017-10-22 16:42+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -32,7 +32,7 @@ msgstr "Akzio mota"
msgid "Actions Model"
msgstr "Akzioen eredua"

#: ./collective/easyform/browser/actions.py:292
#: ./collective/easyform/browser/actions.py:295
msgid "Add new action"
msgstr "Akzio berria gehitu"

Expand Down Expand Up @@ -67,7 +67,7 @@ msgstr ""
msgid "Choose an adapter."
msgstr ""

#: ./collective/easyform/browser/actions.py:175
#: ./collective/easyform/browser/actions.py:176
msgid "Clear all"
msgstr "Guztiak ezabatu"

Expand Down Expand Up @@ -95,11 +95,11 @@ msgstr ""
msgid "EasyForm"
msgstr "EasyForm"

#: ./collective/easyform/browser/actions.py:355
#: ./collective/easyform/browser/actions.py:358
msgid "Edit Action '${fieldname}'"
msgstr "'${fieldname}' akzioa aldatu"

#: ./collective/easyform/browser/actions.py:360
#: ./collective/easyform/browser/actions.py:363
msgid "Edit XML Actions Model"
msgstr "Akzioen XML eredua editatu"

Expand Down Expand Up @@ -262,6 +262,11 @@ msgstr ""
msgid "Your E-Mail Address"
msgstr ""

#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view."
#: ./collective/easyform/interfaces/savedata.py:96
msgid "batch_size_text"
msgstr ""

#. Default: "Reset"
#: ./collective/easyform/interfaces/easyform.py:34
msgid "default_resetLabel"
Expand Down Expand Up @@ -635,6 +640,11 @@ msgstr "Formularioa ezartzeko scripta"
msgid "label_autofocus"
msgstr ""

#. Default: "Batch size"
#: ./collective/easyform/interfaces/savedata.py:95
msgid "label_batch_size"
msgstr ""

#. Default: "BCC Expression"
#: ./collective/easyform/interfaces/mailer.py:497
msgid "label_bcc_override_text"
Expand Down
Loading

0 comments on commit c62790b

Please sign in to comment.