Skip to content

Commit

Permalink
Intermediate commit
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Jan 22, 2025
1 parent 97674b1 commit b5049d6
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 8 deletions.
15 changes: 14 additions & 1 deletion redturtle/bandi/profiles/default/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,25 @@
<value key="enabled">True</value>
<value key="sortable">False</value>
<value key="operations">
<element>plone.app.querystring.operation.selection.is</element>
<element>plone.app.querystring.operation.selection.bando_state_is</element>
</value>
<value key="vocabulary">redturtle.bandi.vocabularies.bandi_states</value>
<value key="group"
i18n:translate=""
>Bando</value>
</records>

<records interface="plone.app.querystring.interfaces.IQueryOperation"
prefix="plone.app.querystring.operation.selection.bando_state_is"
>
<value key="title"
i18n:translate=""
>Is</value>
<value key="description"
i18n:translate=""
>Tip: you can use * to autocomplete.</value>
<value key="operation">plone.app.querystring.queryparser._equal</value>
<value key="widget">SelectionWidget</value>
</records>

</registry>
37 changes: 37 additions & 0 deletions redturtle/bandi/profiles/to_2300/registry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<registry xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="redturtle.bandi">

<records interface="plone.app.querystring.interfaces.IQueryOperation"
prefix="plone.app.querystring.operation.selection.bando_state_is"
>
<value key="title"
i18n:translate=""
>Is</value>
<value key="description"
i18n:translate=""
>Tip: you can use * to autocomplete.</value>
<value key="operation">plone.app.querystring.queryparser._equal</value>
<value key="widget">SelectionWidget</value>
</records>

<records interface="plone.app.querystring.interfaces.IQueryField"
prefix="plone.app.querystring.field.bando_state"
>
<value key="title"
i18n:translate=""
>Stato del bando</value>
<value key="description"
i18n:translate=""
></value>
<value key="enabled">True</value>
<value key="sortable">False</value>
<value key="operations">
<element>plone.app.querystring.operation.selection.is</element>
</value>
<value key="vocabulary">redturtle.bandi.vocabularies.bandi_states</value>
<value key="group"
i18n:translate=""
>Bando</value>
</records>

</registry>
22 changes: 16 additions & 6 deletions redturtle/bandi/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def migrate_to_1100(context):
)

criteria_mapping = {
u"getTipologia_bando": u"tipologia_bando",
u"getChiusura_procedimento_bando": u"chiusura_procedimento_bando",
u"getScadenza_bando": u"scadenza_bando",
u"getDestinatariBando": u"destinatari_bando",
"getTipologia_bando": "tipologia_bando",
"getChiusura_procedimento_bando": "chiusura_procedimento_bando",
"getScadenza_bando": "scadenza_bando",
"getDestinatariBando": "destinatari_bando",
}
collections = api.content.find(portal_type="Collection")
tot_results = len(collections)
Expand Down Expand Up @@ -169,7 +169,7 @@ def migrate_to_2101(context):
)
)
bando = brain.getObject()
bando.reindexObject(idxs=['scadenza_bando'])
bando.reindexObject(idxs=["scadenza_bando"])


def migrate_to_2102(context):
Expand All @@ -185,4 +185,14 @@ def migrate_to_2102(context):
)
)
bando = brain.getObject()
bando.reindexObject(idxs=['tipologia_bando_label'])
bando.reindexObject(idxs=["tipologia_bando_label"])


def migrate_to_2300(context):
PROFILE_ID = "profile-redturtle.bandi:to_2300"
context.runAllImportStepsFromProfile(PROFILE_ID)

# update indexes and topics
context.runImportStepFromProfile(
default_profile, "plone.app.registry", run_dependencies=False
)
2 changes: 1 addition & 1 deletion redturtle/bandi/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
description=""
source="2102"
destination="2300"
handler=".upgrades.update_registry"
handler=".upgrades.migrate_to_2300"
profile="redturtle.bandi:default" />

</configure>

0 comments on commit b5049d6

Please sign in to comment.