Skip to main content

collective.address

This package provides some Dexterity behavior to be used in Dexterity based types for:

IAddress behavior, some fields to describe the Address data.

The IAddress Behavior

The IAddress Behavior.

Using the IAddress Behavior into a custom content type.

Using the IAddress Behavior into a custom content type.


IContact behavior, some fields to describe the Contact data.

The IContact Behavior

The IContact Behavior.

Using the IContact Behavior into a custom content type

Using the IContact Behavior into a custom content type.


IPerson behavior, some fields to describe the Person data.

The IPerson Behavior

The IPerson Behavior.

Using the IPerson Behavior into a custom content type

Using the IPerson Behavior into a custom content type.


ISocial behavior, some fields to describe the Person data.

The ISocial Behavior

The ISocial Behavior.

Using the ISocial Behavior into a custom content type.

Using the ISocial Behavior into a custom content type.


Examples

This add-on can be seen in action at the following add-ons:

Translations

This product has been translated into

  • Deutsch

  • Francese

  • Italian

  • Spanish

Installation

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.

Tips

The following are some tips on how to use this add-on.

How to provide a default value for the country field

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.

Compatibility

  • Tested with Python 3.12 and Plone 6.1.2.

License

The project is licensed under the GPLv2.

Contribute

Author

Changelog

1.7 (2026-03-29)

  • Added more improvements about the add-on documentation. [macagua]

  • Added spanish translation. [macagua]

  • Added more improvements about i18n support. [macagua]

1.6 (2019-06-07)

  • Python 3 compatibilty [petschki]

  • Added french translation. [bsuttor]

  • Added italian translation. [arsenico13]

  • Added update.sh script for i18ndude taken directly from plonecli. [arsenico13]

  • Updated DE .po file with the update.sh script. [arsenico13]

1.5 (2017-01-13)

  • Translate country name via pycountry translation catalog. [thet]

  • Code cleanup. [thet]

1.4 (2016-10-06)

  • Add behavior shortnames. [thet]

  • Remove for attribute in behavior registrations, as this is unsupported. [thet]

  • Change all URL fields to use zope.schema.URI. [thet]

  • Added behavior for social media urls. [agitator]

1.3.2 (2015-09-24)

  • Encode SearchableText indexer result in utf-8. [thet]

1.3.1 (2015-08-27)

  • Fix error on creating the title for Person types with non-ascii characters in names. [thet]

1.3 (2015-07-21)

  • Let IAddressable not derive from schema.Model to have a pure marker Interface. [thet]

  • Make sure, all SearchableText parts are seperated by a space. [thet]

1.2 (2015-07-15)

  • Require the last_name attribute of IPerson behavior. [thet]

  • For the IPerson behavior, compute the title from first and last name and add title (not required, hidden) and description to the IPerson behavior. [thet]

1.1 (2015-03-04)

  • Add IContact and IPerson behaviors in addition to the IAddress behavior. [thet]

  • PEP 8. [thet]

1.0 (2014-04-30)

  • initial.

Release files for collective.address 1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.address 1.7
File Size Uploaded
collective_address-1.7.tar.gz 139.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for collective.address 1.7
File Interpreter ABI Platform
collective_address-1.7-py3-none-any.whl Python 3 none any Details

Total release size: 159.2 kB

Release files / collective_address-1.7.tar.gz

Download URL collective_address-1.7.tar.gz
Size 139.0 kB
Tags Source
SHA-256 checksum
How to use checksums
077638aed9535a87fddca90770e21cf1424b56e3154ba7e5e78035f320378574
BLAKE2b-256 checksum
How to use checksums
1494c9a4ab2d7acfb097ca43db1fc87879011463ac77e60a30864eef7351a770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / collective_address-1.7-py3-none-any.whl

Download URL collective_address-1.7-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22425e680992c8edee73a70bba775d777984e33a55de0834360a842d1a667720
BLAKE2b-256 checksum
How to use checksums
1ce17ca4272e0644d6a5acb01b3c65111a9d8bbf6d0b81ee30efeef55b853bfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

1.7 This release

2 release files

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page