Skip to main content

Country selector field plugin for djangocms-form-builder

Project description

pypi python django djangocms license

djangocms-form-builder-countries is a plugin extension for djangocms-form-builder that adds a country selector field to the form builder.

It integrates django-countries with the Django CMS Form Builder, providing a dropdown field with all ISO 3166-1 countries and localized country names.

Key Features

  • Country dropdown field for djangocms-form-builder forms

  • All ISO 3166-1 countries with localized names

  • Configurable “countries first” option to prioritize specific countries (e.g., DACH region: Germany, Austria, Switzerland)

  • Full integration with form builder validation and submission system

  • Bootstrap 5 compatible styling

  • Works with djangocms-form-builder’s XHR-based form submission

Installation

Install the package via pip:

pip install djangocms-form-builder-countries

Or with your preferred package manager.

Configuration

Add the package to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'django_countries',
    'djangocms_form_builder_countries',
    ...
]

No migrations are required as the plugin uses a proxy model.

Usage

After installation, a new “Country” field type will be available in the Django CMS Form Builder structure board under the “Forms” module.

Adding a Country Field

  1. Create or edit a form in the Django CMS structure board

  2. Add a new plugin to the form

  3. Select “Country” from the “Forms” module

  4. Configure the field:

    • Field Label: The label shown to users

    • Field Name: The internal field name for form processing

    • Required: Whether the field is mandatory

    • Placeholder: Text shown when no country is selected

  5. Optionally configure “Countries First” to show specific countries at the top of the dropdown

Countries First Feature

The “Countries First” option allows you to prioritize specific countries at the top of the dropdown list. This is useful for forms targeting specific regions.

For example, for a form targeting the DACH region, you can select:

  • Germany (DE)

  • Austria (AT)

  • Switzerland (CH)

These countries will appear at the top of the list, followed by a separator and all other countries in alphabetical order.

Requirements

  • Python 3.9+

  • Django 4.2+

  • django-cms 4.1+

  • djangocms-form-builder 2.0+

  • django-countries 7.0+

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add some amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangocms_form_builder_countries-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file djangocms_form_builder_countries-0.1.0.tar.gz.

File metadata

File hashes

Hashes for djangocms_form_builder_countries-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4aaeccbf255b9bfb59c4f652ae4466d2a97a3c3ee0f3db83294a511ad2b04bf8
MD5 7d9fb596186c05a0e3f6730050ba342a
BLAKE2b-256 e42527272e08ea311b913f0d1381d112f02445f3d097bc3496f06cb4f0f3c33a

See more details on using hashes here.

Provenance

The following attestation bundles were made for djangocms_form_builder_countries-0.1.0.tar.gz:

Publisher: publish.yml on altipard/djangocms-form-builder-countries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djangocms_form_builder_countries-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_form_builder_countries-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 196ec74b735eca964c3c5659bd7fe7e229955dc059b97cd4f3c83a91a2e48143
MD5 b4aa17145309626e5e4730c2ba82695c
BLAKE2b-256 520a3583a8460d422dc7e5ce50e9588c8a08d1642828e948ef97ddff2463d7ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for djangocms_form_builder_countries-0.1.0-py3-none-any.whl:

Publisher: publish.yml on altipard/djangocms-form-builder-countries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page