Form rendering for Django
Project description
This library offers an improved replacement for Django’s own form rendering methods (as_p, as_table etc.) while staying simple and extensible but without introducing a whole new framework.
django-fineforms consists of a template tag library and a few opinionated default templates.
Goals
Stay simple and extensible
Avoid options, settings and customizability as much as possible
Non-goals
Compete with django-crispy-forms or any of the more flexible libraries out there
Installation
Simply pip install django-fineforms, and add fineforms to your INSTALLED_APPS.
High-level overview
The template tags mostly wrap their arguments in wrapper classes that do the real work. For example, {% ff_field %} simply wraps the passed field in a wrapper defined in the FINEFORMS_WRAPPERS setting. All wrappers use a template to render their output. The default wrapper types are as follows:
{ "errors": ErrorsWrapper, "field": FieldWrapper, "field-plain": PlainFieldWrapper, "fields": FieldsWrapper, }
The wrappers themselves mostly aren’t configurable, but you can replace individual wrappers (or all of them) by adding a FINEFORMS_WRAPPERS setting. You do not have to override all of them; if you only want to add another wrapper for a specific field type you could just set:
FINEFORMS_WRAPPERS = { "specific": "app.wrappers.SpecificWrapper", }
… and use this wrapper as {% ff_field some_field type='specific' %} somewhere in your templates.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_fineforms-0.6.1.tar.gz
.
File metadata
- Download URL: django_fineforms-0.6.1.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ecfb75395b234bfc1a8eaa43c8f32236cf4a2815d468a68f5e06b48698007d5 |
|
MD5 | 216bbd22a24ca7b8dd2926bf3a95e3a5 |
|
BLAKE2b-256 | d585b5182823de68a0128d0503ab1e45336407fcda64ba21dea86140a0caea2c |
File details
Details for the file django_fineforms-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: django_fineforms-0.6.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cebe02c7e02bb2512193aa3954864bd106583bc704f7871838642bcca81a0153 |
|
MD5 | bf8887ed12139c443209bab1d6cc6fea |
|
BLAKE2b-256 | 7a221de6b7a84e27308b56bb17fc434a4fc1d77155dc5591a8914c3a5f7345a0 |