Metadata-Version: 2.4
Name: djangocms-form-builder-countries
Version: 0.1.0
Summary: Country selector field plugin for djangocms-form-builder
Author: Daniel Altiparmak
License: MIT
Project-URL: Homepage, https://github.com/daltiparmak/djangocms-form-builder-countries
Project-URL: Documentation, https://github.com/daltiparmak/djangocms-form-builder-countries#readme
Project-URL: Repository, https://github.com/daltiparmak/djangocms-form-builder-countries
Project-URL: Issues, https://github.com/daltiparmak/djangocms-form-builder-countries/issues
Keywords: django,django-cms,djangocms-form-builder,countries,form,plugin
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django CMS
Classifier: Framework :: Django CMS :: 4.1
Classifier: Framework :: Django CMS :: 5.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: Django>=4.2
Requires-Dist: django-cms>=4.1
Requires-Dist: djangocms-form-builder>=0.4
Requires-Dist: django-countries>=7.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-django>=4.5; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: tox>=4.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: pre-commit>=3.0; extra == "dev"
Dynamic: license-file

================================
djangocms-form-builder-countries
================================

|pypi| |python| |django| |djangocms| |license|

**djangocms-form-builder-countries** is a plugin extension for
`djangocms-form-builder <https://github.com/django-cms/djangocms-form-builder>`_
that adds a country selector field to the form builder.

It integrates `django-countries <https://github.com/SmileyChris/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.


.. |pypi| image:: https://img.shields.io/pypi/v/djangocms-form-builder-countries.svg
    :target: https://pypi.org/project/djangocms-form-builder-countries/

.. |python| image:: https://img.shields.io/pypi/pyversions/djangocms-form-builder-countries.svg
    :target: https://pypi.org/project/djangocms-form-builder-countries/

.. |django| image:: https://img.shields.io/badge/django-4.2%20%7C%205.0%20%7C%205.1%20%7C%205.2-blue.svg
    :target: https://www.djangoproject.com/

.. |djangocms| image:: https://img.shields.io/badge/django--cms-4.1%20%7C%205.0-blue.svg
    :target: https://www.django-cms.org/

.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg
    :target: https://opensource.org/licenses/MIT
