This package provides some Dexterity behavior to be used in Dexterity based types for:
IAddress behavior, some fields to describe the Address data.
IContact behavior, some fields to describe the Contact data.
IPerson behavior, some fields to describe the Person data.
ISocial behavior, some fields to describe the Person data.
This add-on can be seen in action at the following add-ons:
- https://github.com/collective/collective.venue
- https://github.com/g24at/g24.elements
- https://github.com/b4oshany/rohberg.bluechurch
- https://github.com/RedTurtle/iosanita.contenttypes
- https://github.com/RedTurtle/design.plone.ctgeneric
- https://github.com/RedTurtle/design.plone.contenttypes
This product has been translated into
- Deutsch
- Francese
- Italian
- Spanish
If you installed Plone with Cookieplone, you can install collective.address add-on
from a source control system such as GitHub.
Add a line with collective.address in the backend/requirements.txt file.
collective.address
Next add the add-on to zcml_package_includes in the file backend/instance.yaml so
that its configuration will load.
default_context:
zcml_package_includes: project_title, collective.address
Finally, add the package's source to the mx.ini file.
[collective.address] url = https://github.com/collective/collective.address.git pushurl = git@github.com:collective/collective.address.git branch = master
To actually download and install the new add-on, run the following command.
make backend-build
Now restart the backend.
If you installed Plone with buildout, you can install collective.address add-on
by adding it to your buildout eggs list like so:
[buildout]
...
eggs =
collective.address
and then running bin/buildout
Now restart the instance.
The following are some tips on how to use this add-on.
If you want to provide a default value for the IAddress country field, you can
provide an ComputedWidgetAttribute adapter like so:
from zope.component import provideAdapter
from z3c.form.widget import ComputedWidgetAttribute
from collective.address.behaviors import IAddress
DEFAULT_COUNTRY = "040" # Austria
provideAdapter(ComputedWidgetAttribute(
lambda data: DEFAULT_COUNTRY,
field=IAddress['country']), name='default')
The country code must be the numeric ISO 3166-1 code as a string. You can find the list of codes here: https://en.wikipedia.org/wiki/ISO_3166-1_numeric
If you want to play with the country codes in a Python shell, you can use the
pycountry package like so:
>>> import pycountry >>> austria = pycountry.countries.get(numeric='040') >>> austria Country(alpha_2='AT', alpha_3='AUT', flag='🇦🇹', name='Austria', numeric='040', official_name='Republic of Austria') >>> spain = pycountry.countries.get(alpha_2='ES') >>> spain Country(alpha_2='ES', alpha_3='ESP', flag='🇪🇸', name='Spain', numeric='724', official_name='Kingdom of Spain')
You can install pycountry via pip:
pip3 install pycountry
For more information, see the pycountry documentation.
- Tested with Python 3.12 and Plone 6.1.2.
The project is licensed under the GPLv2.
- Issue Tracker: https://github.com/collective/collective.address/issues
- Source Code: https://github.com/collective/collective.address






