Skip to main content

conjunto-formbuilder

A visual form builder for conjunto-based Django projects. Forms are assembled in a UI and stored as JSON — the JSON definition is the contract: build_form(schema) turns it into a live Django form for rendering, validation and cleaned data, without hand-written field code.

The package depends only on Django and conjunto, so it runs in any conjunto project.

Install

pip install conjunto-formbuilder
# settings.py
INSTALLED_APPS = [
    # …
    "conjunto_formbuilder",
]

Concept

[ Builder UI ]  ──►  schema (JSON)  ──►  build_form(schema)  ──►  Django Form

A field descriptor carries more than type/label/required: grid layout coordinates (x/y/w/h) and optional source (queryset autocomplete) / provision (prefill from a registered data source) descriptors.

from conjunto_formbuilder.build import build_form

schema = {
    "version": 1,
    "layout": "grid",
    "columns": 12,
    "fields": [
        {"name": "first_name", "type": "text", "label": "First name", "required": True,
         "grid": {"x": 0, "y": 0, "w": 6, "h": 1}},
        {"name": "birth_date", "type": "date", "label": "Date of birth",
         "grid": {"x": 6, "y": 0, "w": 6, "h": 1}},
    ],
}

form = build_form(schema, data=request.POST or None)
if form.is_valid():
    ...  # form.cleaned_data

Extending

  • Field types — register a FieldType with conjunto_formbuilder.registry.register_field_type.

Data sources

A field's source (autocomplete) and provision (prefill) descriptors never name a model or queryset directly — that would let a stored form definition reach into arbitrary tables. Instead they name a provider by its key. A provider is a conjunto_formbuilder.datasources.IDataSource (a GDAPS interface) you implement; it returns data through its own, typically tenant-aware, queryset and is responsible for validating the params it accepts.

from conjunto_formbuilder.datasources import IDataSource
from myapp.models import Country


class CountrySource(IDataSource):
    """Generic model-queryset provider: autocomplete + prefill for countries."""

    key = "myapp.country"

    def get_queryset(self, request, params):
        # Scope here (tenant, permissions, params) — this is the trust boundary.
        return Country.objects.all()

    def search(self, request, params, query):
        # Candidates for the typed query; the options partial renders each as
        # ``{{ obj.pk }}`` / ``{{ obj }}``.
        return self.get_queryset(request, params).filter(name__icontains=query)[:20]

    def resolve(self, request, params):
        # A single value to prefill the field with, or ``None``.
        return self.get_queryset(request, params).values_list("pk", flat=True).first()

Reference it from a field:

{"name": "country", "type": "autocomplete",
 "source":    {"provider": "myapp.country", "params": {}},
 "provision": {"provider": "myapp.country", "params": {}}}

build_form wires the autocomplete widget's URL to the AutocompleteOptionsView, carrying the provider key (and any params) as query arguments; the widget sends the typed text as ?q=…. The view resolves the provider against the registry only — an unknown key yields 404. When the builder URLs are mounted under a different namespace, override the reversed URL name via the autocomplete_url_name= argument of build_form_class or the CONJUNTO_FORMBUILDER_AUTOCOMPLETE_URL_NAME setting.

License

AGPL-3.0-or-later.

Metadata

Release files for conjunto-formbuilder 0.1.0

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

Source distribution (sdist)

Source distribution for conjunto-formbuilder 0.1.0
File Size Uploaded Provenance
conjunto_formbuilder-0.1.0.tar.gz 41.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for conjunto-formbuilder 0.1.0
File Interpreter ABI Platform
conjunto_formbuilder-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.3 kB

Release files / conjunto_formbuilder-0.1.0.tar.gz

Download URL conjunto_formbuilder-0.1.0.tar.gz
Size 41.7 kB
Tags Source
SHA-256 checksum
How to use checksums
25a86812ef8cf87507786fbb909ff9edb2074d9047ebff383caaebe3a06322a4
BLAKE2b-256 checksum
How to use checksums
384806db416c67789d08d9e2aa72b35297da1c956de530391fa087dd6cda6979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"KDE neon","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / conjunto_formbuilder-0.1.0-py3-none-any.whl

Download URL conjunto_formbuilder-0.1.0-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85a86062b6981af6f4cfd0bbf18cd085b1471ce2846176902605b062f153d3d0
BLAKE2b-256 checksum
How to use checksums
ede40122abddb93842a2967fc5e87796e265c53c151bdc6a983b6db83cb2a581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"KDE neon","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for conjunto-formbuilder 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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