Keeping you DRY since 2010
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
Hashes for django_fineforms-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 601c0063af8f4e419f20a8feec8aad2e8cb8582d73bd104f5766e23be7b27982 |
|
MD5 | 2381a9f9a3d5b14de7cba0b0004a33b3 |
|
BLAKE2b-256 | d7fac9158fb9d0d406210b000662fcbedda71c69ae1b41cd6ff1ed7dece12e4e |