Metadata-Version: 2.4
Name: formkit-ninja
Version: 0.8.1
Summary: A Django-Ninja backend to specify FormKit schemas
Author-email: Josh Brooks <josh@catalpa.io>
Requires-Python: <3.14,>=3.10
Requires-Dist: django-ninja<1
Requires-Dist: django-pghistory==3.*
Requires-Dist: django-pgtrigger==4.*
Requires-Dist: django==4.*
Requires-Dist: pydantic<2
Requires-Dist: rich
Description-Content-Type: text/markdown

# Formkit-Ninja

A Django-Ninja framework for FormKit schemas and form submissions

## Why

FormKit out of the box has awesome schema support - this lets us integrate FormKit instances as Django models

- Upload / edit / download basic FormKit schemas
- Translated "option" values from the Django admin
- Reorder "options" and schema nodes
- List and Fetch schemas for different form types

## Use

To use, `pip install formkit-ninja` and add the following to settings `INSTALLED_APPS`:

```py
INSTALLED_APPS = [
    ...
    "formkit_ninja",
    "ninja",
    ...
]
```

## Test

Pull the repo:

`gh repo clone catalpainternational/formkit-ninja`
`cd formkit-ninja`
`uv sync`
`uv run pytest`

### Playwright

Some tests require playwright. Do:
`uv run playwright install`

## Lint

`uv run black --check .`
`uv run isort --check .`
`uv run flake8 .`

# Updating 'Protected' Nodes

If a node's been protected you cannot change or delete it. To do so, you'll need to temporarily disable the trigger which is on it.

`./manage.py pytrigger disable protect_node_deletes_and_updates`
Make changes
`./manage.py pgtrigger enable protect_node_deletes_and_updates`

See the documentation for more details: https://django-pgtrigger.readthedocs.io/en/2.3.0/commands.html?highlight=disable