Skip to main content

HOPE FlexFields

Test Lint codecov Documentation PyPI

This library provides the ability to define a set of fields and related validation rules dynamically. It has been designed as part of the HOPE project to manage user-customizable fields (FlexField). The idea is to have a central business logic repository for data import validation.

It provides four classes:

  • FieldDefinition: This represents a collection of reusable pre-configured fields
  • FlexField: Instance like representation of FieldDefinition inside a Fieldset
  • Fieldset: Group of FlexField
  • DataChecker: Compound of fieldset

From the design point of view a high level comparison with Django components could be:

  • FieldDefinition = class forms.Field
  • Fieldset = forms.Form
  • FlexField = forms.Field()
  • DataChecker = [forms.Form(),...]

... and some utilities

classDiagram
    class AbstractField
    class FieldDefinition
    class FlexField
    class Fieldset
    class DataChecker
    AbstractField <|-- FlexField
    AbstractField <|-- FieldDefinition
    Fieldset *-- FlexField
    FlexField --> FieldDefinition
    DataChecker o-- Fieldset

Install

CSP_SCRIPT_SRC = [
    ...
    "cdnjs.cloudflare.com",
]

INSTALLED_APPS = [
    ...
    'admin_extra_buttons',
    'jsoneditor',
    'hope_flex_fields',

]

Demo Application

pip install -e .
python manage.py migrate
python manage.py demo
python manage.py runserver

Demo Application with UV

uv venv
uv sync
uv run pip install -e .
uv run python manage.py migrate
uv run python manage.py demo
uv run python manage.py runserver

Navigate to http://localhost:8000/admin/ and login using any username/password

Download files

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

Source Distribution

hope_flex_fields-0.9.1.tar.gz (237.8 kB view details)

Uploaded Source

Built Distribution

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

hope_flex_fields-0.9.1-py3-none-any.whl (279.3 kB view details)

Uploaded Python 3

File details

Details for the file hope_flex_fields-0.9.1.tar.gz.

File metadata

  • Download URL: hope_flex_fields-0.9.1.tar.gz
  • Upload date:
  • Size: 237.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for hope_flex_fields-0.9.1.tar.gz
Algorithm Hash digest
SHA256 fc46d27bdda819cb678b872410e7706b4fa9d3cd291e1697c9f10d1e7905f1de
MD5 73ae2f3c4ba7d3cbe653c0e0744b4380
BLAKE2b-256 4b13b4450480e3d6d56cabb5e8992ac212bcdcbeff862a31e3e30e3b2bc28546

See more details on using hashes here.

Provenance

The following attestation bundles were made for hope_flex_fields-0.9.1.tar.gz:

Publisher: release.yml on unicef/hope-flex-fields

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

File details

Details for the file hope_flex_fields-0.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hope_flex_fields-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acf928434280a6b54f2938c20ef676dc9c1b8bfea18a700ff0c34dcadd04dc81
MD5 bafe49adf5c386416e77a794f0f0615c
BLAKE2b-256 61f2c2daae57ef671615d6be132febe9c2f4041586c2a53d5f8d1bde74218179

See more details on using hashes here.

Provenance

The following attestation bundles were made for hope_flex_fields-0.9.1-py3-none-any.whl:

Publisher: release.yml on unicef/hope-flex-fields

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

Release history Release notifications | RSS feed

This release

0.9.1 This release

2 files

0.8.5

2 files

0.8.1

2 files

0.7.7

2 files

0.7.6

2 files

0.7.5

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

1 file

0.6.1

2 files

0.6.0

1 file

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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