Django form rendering helpers
Project description
Overview
Rendering forms with Django can be painful and not very rewarding. There are some nice solutions arround like django-floppyforms or django-crispy-forms but you may want something a bit less complex.
Formica design is heavily based on Formulation, a very lightweight, yet powerful, solution based on template blocks. All credits should go to Curtis Maloney for this impressive and simple idea.
A simple example
Say we have a form somewhere and want to render it in a template.
from django import forms class MyForm(forms.Form): email = forms.EmailField(label='Email') check = forms.BooleanField(label='I really love spam', required=False)
Rendering the form is as simple as:
{% load formica %} <form method="post"> {% form "formica/base_form.html" %} {% fields %} {% endform %} <p><input type="submit" value="save" /></p> </form>
Pretty cool isn’t it? Read the documentation to learn more.
Sources & license
Formica sources are hosted on Github: https://github.com/olivier-m/formica
Formica is released under the FreeBSD license.
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
File details
Details for the file formica-1.1.tar.gz
.
File metadata
- Download URL: formica-1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0c725a02d35dea0304a50e934cb8d49256f59aaaca2273589ad3e62e6a49e2 |
|
MD5 | 447295d3cb92c019604e59894e9e05dd |
|
BLAKE2b-256 | 0f8c223a77ceef84a9fb6796c85fc8cf242ee92d79f5beb43f8a9cf1c068d723 |