New in version 0.2.
This tutorial will explain to you how to write extensions to Formular. An extension can provide field, form and widget types. Once your extension is installed these can be imported seamlessly.
You write an extension just like any other application. In your setup.py you have to specifiy an entry point:
from setuptools import setup
setup(
name="Your Plugin",
version="0.1",
description="Spam fields for Formular",
entry_points="""
[formular.extensions]
whatever = your_module:data
"""
)
As you can see formular.extensions is the entry point but what is data? It’s simply a dictionary which looks like this:
data = {
"fields": {"YourField": YourField}
}
Possible keys are "fields", "widgets" and "forms". "YourField" will be the name under which YourField will be reachable.