From d217c98deadafb641b4299ca6961e797e3584222 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Thu, 2 Oct 2025 17:31:07 +0200 Subject: [PATCH 01/12] added Service Provider content type --- .../src/ploneorg/content/serviceprovider.py | 356 ++++++++++++++++++ 1 file changed, 356 insertions(+) create mode 100644 backend/src/ploneorg/src/ploneorg/content/serviceprovider.py diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py new file mode 100644 index 0000000..f28e3f0 --- /dev/null +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -0,0 +1,356 @@ +# -*- coding: utf-8 -*- +from zope.interface import implementer, alsoProvides +from plone.dexterity.content import Item +from plone.supermodel.model import Schema +from plone.supermodel.directives import fieldset +from plone.autoform.directives import read_permission +from plone.namedfile.field import NamedBlobImage +from plone.rfc822.interfaces import IPrimaryField +from plone.app.textfield import RichText +from plone.app.content.interfaces import INameFromTitle +from ploneorg import _ +from ploneorg.vocabularies import countries_vocabulary, languages_vocabulary + +from zope import schema + +from ploneorg.content.foundationsponsor import isEmail, isHTTP + + +class IServiceProvider(Schema): + + fieldset( + "ContactPerson", + label="Contact Person", + fields=["contact_fullname", "contact_email", "contact_phone", "contact_role"], + ) + + fieldset( + "Contacts", + label="Contacts", + fields=[ + "address", + "city", + "zip_code", + "contact_country", + "email1", + "email2", + "phone1", + "phone2", + "website", + "contact_form_url", + ], + ) + + fieldset( + "Social", + label="Social Media", + fields=["linkedin", "instagram", "youtube", "facebook", "twitter"], + ) + + fieldset( + "Photos", + label="Photos", + fields=["photo1", "photo2", "photo3", "photo4", "photo5"], + ) + + title = schema.TextLine( + title=_("Company Name"), + description=_("The official company name."), + required=True, + ) + + description = schema.Text( + title=_("Short Description"), + description=_("A short summary of the company (1–2 sentences)."), + required=True, + ) + + logo = NamedBlobImage( + title=_("Logo"), + description=_("Upload the company logo (used as primary image)."), + required=True, + ) + + sponsor_level = schema.Choice( + title=_("Sponsor Level"), + description=_("Choose the sponsorship level if applicable."), + values=["Basic", "Standard", "Premium"], + required=False, + ) + + website = schema.URI( + title=_("Website"), + description=_("Main website URL. Must start with http:// or https://."), + required=True, + constraint=isHTTP, + ) + + rating = schema.Int( + title=_("Rating"), + description=_("Internal rating, between 1 and 5."), + min=1, + max=5, + required=False, + ) + + languages = schema.List( + title=_("Languages"), + description=_("Languages spoken or supported by the provider."), + value_type=schema.Choice(vocabulary=languages_vocabulary), + required=False, + ) + + country = schema.Choice( + title=_("Country"), + description=_("Select the primary country of operation."), + vocabulary=countries_vocabulary, + required=False, + ) + + services = RichText( + title=_("Services"), + description=_("Detailed description of services offered."), + required=False, + ) + + portfolio = RichText( + title=_("Portfolio / Case Studies"), + description=_("Showcase past projects, implementations, and case studies."), + required=False, + ) + + certifications = RichText( + title=_("Certifications"), + description=_("Relevant certifications or awards."), + required=False, + ) + + body = RichText( + title=_("Full Body Text"), + description=_("Full-length company profile, story, or extended content."), + required=False, + ) + + customer_retention = schema.Int( + title=_("Customer Retention %"), + description=_("Percentage of customers retained (optional metric)."), + required=False, + ) + + industries = schema.List( + title=_("Industries"), + description=_("Industries served by this provider."), + value_type=schema.Choice( + values=[ + "University & Education", + "Non-Profit & NGO", + "Oil & Gas", + "Government & Public Sector", + "Finance & Banking", + "Healthcare & Life Sciences", + "Media & Publishing", + "Transport & Logistics", + "Retail & E-commerce", + "Technology & IT Services", + "Legal Services", + "Professional Services", + "Manufacturing & Industry", + "Energy & Utilities", + "Telecommunications", + ] + ), + required=False, + ) + + contact_fullname = schema.TextLine( + title=_("Full Name"), + description=_("Primary contact person full name."), + required=False, + ) + + contact_email = schema.TextLine( + title=_("Email"), + description=_("Primary contact email address."), + constraint=isEmail, + required=False, + ) + + contact_phone = schema.TextLine( + title=_("Phone"), + description=_("Primary contact phone number."), + required=False, + ) + + contact_role = schema.TextLine( + title=_("Role"), + description=_("Job title or role of the contact person."), + required=False, + ) + + address = schema.TextLine( + title=_("Address"), + description=_("Street address of the office."), + required=False, + ) + + city = schema.TextLine( + title=_("City"), + description=_("City where the office is located."), + required=False, + ) + + zip_code = schema.TextLine( + title=_("ZIP Code"), + description=_("Postal/ZIP code."), + required=False, + ) + + contact_country = schema.Choice( + title=_("Country"), + description=_("Country of the contact office."), + vocabulary=countries_vocabulary, + required=False, + ) + + email1 = schema.TextLine( + title=_("Email 1"), + description=_("General contact email address."), + constraint=isEmail, + required=False, + ) + + email2 = schema.TextLine( + title=_("Email 2"), + description=_("Secondary contact email address."), + constraint=isEmail, + required=False, + ) + + phone1 = schema.TextLine( + title=_("Phone 1"), + description=_("General contact phone number."), + required=False, + ) + + phone2 = schema.TextLine( + title=_("Phone 2"), + description=_("Secondary contact phone number."), + required=False, + ) + + contact_form_url = schema.URI( + title=_("Contact Form URL"), + description=_("Direct link to an external contact form."), + constraint=isHTTP, + required=False, + ) + + linkedin = schema.URI( + title=_("LinkedIn"), + description=_("Link to LinkedIn company or profile page."), + required=False, + constraint=isHTTP, + ) + + instagram = schema.URI( + title=_("Instagram"), + description=_("Link to Instagram profile."), + required=False, + constraint=isHTTP, + ) + + youtube = schema.URI( + title=_("YouTube Channel"), + description=_("Link to YouTube company channel."), + required=False, + constraint=isHTTP, + ) + + facebook = schema.URI( + title=_("Facebook"), + description=_("Link to Facebook page."), + required=False, + constraint=isHTTP, + ) + + twitter = schema.TextLine( + title=_("Twitter"), + description=_("Twitter handle, without the leading @."), + required=False, + ) + + photo1 = NamedBlobImage( + title=_("Photo 1"), description=_("Optional showcase photo."), required=False + ) + photo2 = NamedBlobImage( + title=_("Photo 2"), description=_("Optional showcase photo."), required=False + ) + photo3 = NamedBlobImage( + title=_("Photo 3"), description=_("Optional showcase photo."), required=False + ) + photo4 = NamedBlobImage( + title=_("Photo 4"), description=_("Optional showcase photo."), required=False + ) + photo5 = NamedBlobImage( + title=_("Photo 5"), description=_("Optional showcase photo."), required=False + ) + + +alsoProvides(IServiceProvider["logo"], IPrimaryField) + + +@implementer(IServiceProvider) +class ServiceProvider(Item): + + def get_full_name(self): + return self.title + + @property + def preview_image(self): + return self.logo + + @preview_image.setter + def preview_image(self, value): + self.logo = value + + @property + def preview_caption(self): + return self.title + + @preview_caption.setter + def preview_caption(self, value): + pass + + @property + def remoteUrl(self): + return self.website + + @remoteUrl.setter + def remoteUrl(self, value): + self.website = value + + def toXML(self, schematas=None): + if schematas is None: + schematas = ["Contacts", "ContactPerson", "Social"] + out = f'' + for name in schematas: + value = getattr(self, name, None) + if value: + out += f"<{name}>{value}" + out += "" + return out + + +class INameFromCompany(INameFromTitle): + def title(): + """Return processed title""" + + +@implementer(INameFromCompany) +class NameFromCompany(object): + def __init__(self, context): + self.context = context + + @property + def title(self): + return self.context.title From 21be2f90288b490761cd20e5da5732882652aff6 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 00:26:53 +0200 Subject: [PATCH 02/12] register ServiceProvider type and fix formatting --- .../default/types/ServiceProvider.xml | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 backend/src/ploneorg/src/ploneorg/profiles/default/types/ServiceProvider.xml diff --git a/backend/src/ploneorg/src/ploneorg/profiles/default/types/ServiceProvider.xml b/backend/src/ploneorg/src/ploneorg/profiles/default/types/ServiceProvider.xml new file mode 100644 index 0000000..6174c90 --- /dev/null +++ b/backend/src/ploneorg/src/ploneorg/profiles/default/types/ServiceProvider.xml @@ -0,0 +1,75 @@ + + + Service provider + Plone CMS Service Provider + serviceprovider + string:${folder_url}/++add++ServiceProvider + + view + True + True + + False + view + + + + False + ploneorg.serviceprovider.add + ploneorg.content.serviceprovider.ServiceProvider + + + + + + + + ploneorg.content.serviceprovider.IServiceProvider + + + dexterity + + + + + + + + + + + From 315e6d450ecb66e0cdadfbf964ed276c94b82079 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 00:37:39 +0200 Subject: [PATCH 03/12] add missing types.xml and fix linters for serviceprovider.py --- .../src/ploneorg/content/serviceprovider.py | 22 +++++++++---------- .../src/ploneorg/profiles/default/types.xml | 3 +++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index f28e3f0..d2ac5a4 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -1,19 +1,20 @@ # -*- coding: utf-8 -*- -from zope.interface import implementer, alsoProvides -from plone.dexterity.content import Item -from plone.supermodel.model import Schema -from plone.supermodel.directives import fieldset +from plone.app.content.interfaces import INameFromTitle +from plone.app.textfield import RichText from plone.autoform.directives import read_permission +from plone.dexterity.content import Item from plone.namedfile.field import NamedBlobImage from plone.rfc822.interfaces import IPrimaryField -from plone.app.textfield import RichText -from plone.app.content.interfaces import INameFromTitle +from plone.supermodel.directives import fieldset +from plone.supermodel.model import Schema from ploneorg import _ -from ploneorg.vocabularies import countries_vocabulary, languages_vocabulary - +from ploneorg.content.foundationsponsor import isEmail +from ploneorg.content.foundationsponsor import isHTTP +from ploneorg.vocabularies import countries_vocabulary +from ploneorg.vocabularies import languages_vocabulary from zope import schema - -from ploneorg.content.foundationsponsor import isEmail, isHTTP +from zope.interface import alsoProvides +from zope.interface import implementer class IServiceProvider(Schema): @@ -301,7 +302,6 @@ class IServiceProvider(Schema): @implementer(IServiceProvider) class ServiceProvider(Item): - def get_full_name(self): return self.title diff --git a/backend/src/ploneorg/src/ploneorg/profiles/default/types.xml b/backend/src/ploneorg/src/ploneorg/profiles/default/types.xml index caa3fc7..7c077d8 100644 --- a/backend/src/ploneorg/src/ploneorg/profiles/default/types.xml +++ b/backend/src/ploneorg/src/ploneorg/profiles/default/types.xml @@ -11,4 +11,7 @@ + From b70614741347a22be16a9b4da2a2b996a1273b10 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 01:16:39 +0200 Subject: [PATCH 04/12] update fielsets and add a few fields to serviceprovider type --- .../src/ploneorg/content/serviceprovider.py | 83 +++++++++++++------ 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index d2ac5a4..e81aa01 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -8,10 +8,10 @@ from plone.supermodel.directives import fieldset from plone.supermodel.model import Schema from ploneorg import _ +from ploneorg.app.vocabularies import AllContentLanguages from ploneorg.content.foundationsponsor import isEmail from ploneorg.content.foundationsponsor import isHTTP -from ploneorg.vocabularies import countries_vocabulary -from ploneorg.vocabularies import languages_vocabulary +from ploneorg.vocabularies.countries import countries_vocabulary from zope import schema from zope.interface import alsoProvides from zope.interface import implementer @@ -20,19 +20,13 @@ class IServiceProvider(Schema): fieldset( - "ContactPerson", - label="Contact Person", - fields=["contact_fullname", "contact_email", "contact_phone", "contact_role"], - ) - - fieldset( - "Contacts", + "Location", label="Contacts", fields=[ "address", "city", "zip_code", - "contact_country", + "country", "email1", "email2", "phone1", @@ -42,6 +36,24 @@ class IServiceProvider(Schema): ], ) + fieldset( + "ContactPerson", + label="Contact Person", + fields=["contact_fullname", "contact_email", "contact_phone", "contact_role"], + ) + + fieldset( + "Services", + label="Services and Portfolio", + fields=[ + "services", + "portfolio", + "industries", + "customer_retention", + "certificates", + ], + ) + fieldset( "Social", label="Social Media", @@ -72,11 +84,16 @@ class IServiceProvider(Schema): required=True, ) - sponsor_level = schema.Choice( - title=_("Sponsor Level"), - description=_("Choose the sponsorship level if applicable."), - values=["Basic", "Standard", "Premium"], - required=False, + sponsorship_type = schema.Choice( + title=_PMF("Sponsor Type", default="Sponsor Type"), + vocabulary="ploneorg.vocabulary.sponsorship_types", + required=True, + ) + orgsize = schema.Choice( + title=_("Organization size"), + description=_("Number of people in your organization. It's fine to estimate."), + vocabulary=org_size_vocabulary, + required=True, ) website = schema.URI( @@ -97,7 +114,7 @@ class IServiceProvider(Schema): languages = schema.List( title=_("Languages"), description=_("Languages spoken or supported by the provider."), - value_type=schema.Choice(vocabulary=languages_vocabulary), + value_type=schema.Choice(vocabulary=AllContentLanguages), required=False, ) @@ -120,8 +137,8 @@ class IServiceProvider(Schema): required=False, ) - certifications = RichText( - title=_("Certifications"), + certificates = RichText( + title=_("Certificates"), description=_("Relevant certifications or awards."), required=False, ) @@ -206,13 +223,6 @@ class IServiceProvider(Schema): required=False, ) - contact_country = schema.Choice( - title=_("Country"), - description=_("Country of the contact office."), - vocabulary=countries_vocabulary, - required=False, - ) - email1 = schema.TextLine( title=_("Email 1"), description=_("General contact email address."), @@ -296,6 +306,29 @@ class IServiceProvider(Schema): title=_("Photo 5"), description=_("Optional showcase photo."), required=False ) + start_date = schema.Date( + title=_PMF("Start Date", default="Start Date"), required=False + ) + + end_date = schema.Date(title=_PMF("End Date", default="End Date"), required=False) + + payment_date = schema.Date( + title=_PMF("Payment Date", default="Payment Date"), required=False + ) + + last_verified_date = schema.Date( + title=_PMF("Status last verified date", default="Status last verified date"), + required=False, + ) + + notes = RichText( + title=_PMF("Private notes", default="Private notes"), required=False + ) + + public_notes = RichText( + title=_PMF("Public notes", default="Public notes"), required=False + ) + alsoProvides(IServiceProvider["logo"], IPrimaryField) From b445f3055fe4e00c5422ae273509ffae75f883d8 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 01:20:19 +0200 Subject: [PATCH 05/12] fix typo --- .../src/ploneorg/content/serviceprovider.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index e81aa01..db0851f 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -85,7 +85,7 @@ class IServiceProvider(Schema): ) sponsorship_type = schema.Choice( - title=_PMF("Sponsor Type", default="Sponsor Type"), + title=_("Sponsor Type", default="Sponsor Type"), vocabulary="ploneorg.vocabulary.sponsorship_types", required=True, ) @@ -307,26 +307,24 @@ class IServiceProvider(Schema): ) start_date = schema.Date( - title=_PMF("Start Date", default="Start Date"), required=False + title=_("Start Date", default="Start Date"), required=False ) - end_date = schema.Date(title=_PMF("End Date", default="End Date"), required=False) + end_date = schema.Date(title=_("End Date", default="End Date"), required=False) payment_date = schema.Date( - title=_PMF("Payment Date", default="Payment Date"), required=False + title=_("Payment Date", default="Payment Date"), required=False ) last_verified_date = schema.Date( - title=_PMF("Status last verified date", default="Status last verified date"), + title=_("Status last verified date", default="Status last verified date"), required=False, ) - notes = RichText( - title=_PMF("Private notes", default="Private notes"), required=False - ) + notes = RichText(title=_("Private notes", default="Private notes"), required=False) public_notes = RichText( - title=_PMF("Public notes", default="Public notes"), required=False + title=_("Public notes", default="Public notes"), required=False ) From b07892374c266a2e495163b6f4e0400d8e053a1b Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 01:22:45 +0200 Subject: [PATCH 06/12] remove unused import --- backend/src/ploneorg/src/ploneorg/content/serviceprovider.py | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index db0851f..fcb737c 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from plone.app.content.interfaces import INameFromTitle from plone.app.textfield import RichText -from plone.autoform.directives import read_permission from plone.dexterity.content import Item from plone.namedfile.field import NamedBlobImage from plone.rfc822.interfaces import IPrimaryField From 856dae983f228dc56eb6c76a1a60e72e870eacc3 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 01:24:28 +0200 Subject: [PATCH 07/12] add missing import --- backend/src/ploneorg/src/ploneorg/content/serviceprovider.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index fcb737c..5a2ce03 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -11,6 +11,7 @@ from ploneorg.content.foundationsponsor import isEmail from ploneorg.content.foundationsponsor import isHTTP from ploneorg.vocabularies.countries import countries_vocabulary +from ploneorg.vocabularies import org_size_vocabulary from zope import schema from zope.interface import alsoProvides from zope.interface import implementer From 5ace48c2c15ac3d7ef185b0eed9583c0cee6adfb Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 01:29:34 +0200 Subject: [PATCH 08/12] fix languages vocab import --- backend/src/ploneorg/src/ploneorg/content/serviceprovider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index 5a2ce03..627a594 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -7,7 +7,7 @@ from plone.supermodel.directives import fieldset from plone.supermodel.model import Schema from ploneorg import _ -from ploneorg.app.vocabularies import AllContentLanguages +from plone.app.vocabularies.language import AllContentLanguages from ploneorg.content.foundationsponsor import isEmail from ploneorg.content.foundationsponsor import isHTTP from ploneorg.vocabularies.countries import countries_vocabulary From 4d618e547200dba496ecb883e32ed34ec14a98eb Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 01:34:52 +0200 Subject: [PATCH 09/12] isort formatting fixes --- backend/src/ploneorg/src/ploneorg/content/serviceprovider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index 627a594..e0580a8 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -1,17 +1,17 @@ # -*- coding: utf-8 -*- from plone.app.content.interfaces import INameFromTitle from plone.app.textfield import RichText +from plone.app.vocabularies.language import AllContentLanguages from plone.dexterity.content import Item from plone.namedfile.field import NamedBlobImage from plone.rfc822.interfaces import IPrimaryField from plone.supermodel.directives import fieldset from plone.supermodel.model import Schema from ploneorg import _ -from plone.app.vocabularies.language import AllContentLanguages from ploneorg.content.foundationsponsor import isEmail from ploneorg.content.foundationsponsor import isHTTP -from ploneorg.vocabularies.countries import countries_vocabulary from ploneorg.vocabularies import org_size_vocabulary +from ploneorg.vocabularies.countries import countries_vocabulary from zope import schema from zope.interface import alsoProvides from zope.interface import implementer From 501719a8eb1514fcf55a31ac723ae7c695ba0067 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 02:27:24 +0200 Subject: [PATCH 10/12] fix vocabulary reference for language field --- backend/src/ploneorg/src/ploneorg/content/serviceprovider.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index e0580a8..1e3febd 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from plone.app.content.interfaces import INameFromTitle from plone.app.textfield import RichText -from plone.app.vocabularies.language import AllContentLanguages from plone.dexterity.content import Item from plone.namedfile.field import NamedBlobImage from plone.rfc822.interfaces import IPrimaryField @@ -114,7 +113,7 @@ class IServiceProvider(Schema): languages = schema.List( title=_("Languages"), description=_("Languages spoken or supported by the provider."), - value_type=schema.Choice(vocabulary=AllContentLanguages), + value_type=schema.Choice(vocabulary="plone.app.vocabularies.AvailableContentLanguages"), required=False, ) From 79cde245f0f97d0b368d23594a7a87a4872ae0fd Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 02:29:06 +0200 Subject: [PATCH 11/12] linters --- backend/src/ploneorg/src/ploneorg/content/serviceprovider.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index 1e3febd..520b51b 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -113,7 +113,9 @@ class IServiceProvider(Schema): languages = schema.List( title=_("Languages"), description=_("Languages spoken or supported by the provider."), - value_type=schema.Choice(vocabulary="plone.app.vocabularies.AvailableContentLanguages"), + value_type=schema.Choice( + vocabulary="plone.app.vocabularies.AvailableContentLanguages" + ), required=False, ) From ecf7e05ee8ca49e2da0616b99e5d95e395b471a1 Mon Sep 17 00:00:00 2001 From: Vitaliy Podoba Date: Fri, 3 Oct 2025 02:42:25 +0200 Subject: [PATCH 12/12] add default schematas list --- backend/src/ploneorg/src/ploneorg/content/serviceprovider.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py index 520b51b..84c314d 100644 --- a/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py +++ b/backend/src/ploneorg/src/ploneorg/content/serviceprovider.py @@ -10,7 +10,6 @@ from ploneorg.content.foundationsponsor import isEmail from ploneorg.content.foundationsponsor import isHTTP from ploneorg.vocabularies import org_size_vocabulary -from ploneorg.vocabularies.countries import countries_vocabulary from zope import schema from zope.interface import alsoProvides from zope.interface import implementer @@ -122,7 +121,7 @@ class IServiceProvider(Schema): country = schema.Choice( title=_("Country"), description=_("Select the primary country of operation."), - vocabulary=countries_vocabulary, + vocabulary="ploneorg.vocabulary.countries", required=False, ) @@ -363,7 +362,7 @@ def remoteUrl(self, value): def toXML(self, schematas=None): if schematas is None: - schematas = ["Contacts", "ContactPerson", "Social"] + schematas = ["Location", "ContactPerson", "Services", "Social", "Photos"] out = f'' for name in schematas: value = getattr(self, name, None)