Skip to content

Commit f08d73a

Browse files
committed
add missing folder and update ci
1 parent 654cc60 commit f08d73a

File tree

13 files changed

+98
-4
lines changed

13 files changed

+98
-4
lines changed

.github/workflows/black.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python-version: ${{ matrix.python-version }}
2020

2121
# python cache
22-
- uses: actions/cache@v1
22+
- uses: actions/cache@v3
2323
with:
2424
path: ~/.cache/pip
2525
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python-version: ${{ matrix.python-version }}
2020

2121
# python cache
22-
- uses: actions/cache@v1
22+
- uses: actions/cache@v3
2323
with:
2424
path: ~/.cache/pip
2525
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}

.github/workflows/pyroma.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python-version: ${{ matrix.python-version }}
2020

2121
# python cache
22-
- uses: actions/cache@v1
22+
- uses: actions/cache@v3
2323
with:
2424
path: ~/.cache/pip
2525
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}

.github/workflows/zpretty.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python-version: ${{ matrix.python-version }}
2020

2121
# python cache
22-
- uses: actions/cache@v1
22+
- uses: actions/cache@v3
2323
with:
2424
path: ~/.cache/pip
2525
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<configure xmlns="http://namespaces.zope.org/zope"
2+
xmlns:gs="http://namespaces.zope.org/genericsetup">
3+
4+
<gs:registerProfile name="1001"
5+
title="Enable tipologia_notizia criteria"
6+
directory="1001"
7+
description='Configuration for version 1001'
8+
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
9+
provides="Products.GenericSetup.interfaces.EXTENSION" />
10+
11+
<gs:upgradeSteps source="1000"
12+
destination="1001"
13+
profile="design.plone.ctgeneric:default">
14+
15+
<gs:upgradeStep title="Enable tipologia_notizia criteria and reindex"
16+
description=""
17+
handler=".v1001.upgrade" />
18+
19+
</gs:upgradeSteps>
20+
21+
</configure>

src/design/plone/ctgeneric/upgrades/1001/.gitkeep

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<object name="portal_catalog">
3+
4+
<column value="tipologia_notizia"/><index name="tipologia_notizia" meta_type="FieldIndex">
5+
<indexed_attr value="tipologia_notizia"/>
6+
</index>
7+
</object>

src/design/plone/ctgeneric/upgrades/1001/metadata.txt

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<registry xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="plone">
3+
<!-- redefine tipologia_notizia criteria to not use taxonomy -->
4+
<records interface="plone.app.querystring.interfaces.IQueryField" prefix="plone.app.querystring.field.tipologia_notizia">
5+
<value key="title" i18n:translate="">Tipologia notizia</value>
6+
<value key="description" i18n:translate="">Tipologia della notizia</value>
7+
<value key="enabled">True</value>
8+
<value key="sortable">False</value>
9+
<value key="operations">
10+
<element>plone.app.querystring.operation.selection.any</element>
11+
<element>plone.app.querystring.operation.selection.all</element>
12+
</value>
13+
<value key="vocabulary">design.plone.vocabularies.tipologie_notizia</value>
14+
<value key="group" i18n:translate="">Metadata</value>
15+
</records>
16+
17+
</registry>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- coding: utf-8 -*
2+
3+
import logging
4+
5+
6+
logger = logging.getLogger("design.plone.ctgeneric")
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
from plone.app.upgrade.utils import loadMigrationProfile
3+
4+
5+
def reload_gs_profile(context):
6+
loadMigrationProfile(
7+
context,
8+
"profile-design.plone.ctgeneric:default",
9+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<configure
2+
xmlns="http://namespaces.zope.org/zope"
3+
i18n_domain="design.plone.ctgeneric">
4+
5+
<!-- -*- extra stuff goes here -*- -->
6+
7+
<include file="1001.zcml" />
8+
9+
</configure>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- coding: utf-8 -*-
2+
from design.plone.ctgeneric.setuphandlers import delete_tipologia_notizia_taxonomy
3+
from plone import api
4+
5+
import logging
6+
7+
logger = logging.getLogger(__name__)
8+
9+
10+
def upgrade(setup_tool=None):
11+
""" """
12+
delete_tipologia_notizia_taxonomy()
13+
14+
setup_tool.runAllImportStepsFromProfile("design.plone.ctgeneric.upgrades:1001")
15+
16+
brains = api.content.find(portal_type="News Item")
17+
tot = len(brains)
18+
i = 0
19+
for brain in brains:
20+
i += 1
21+
if i % 100 == 0:
22+
logger.info(f"Processing {i} of {tot}")
23+
obj = brain.getObject()
24+
if getattr(obj, "tipologia_notizia", ""):
25+
obj.reindexObject(idxs=["tipologia_notizia"])

0 commit comments

Comments
 (0)