A form field that accepts a Django form as its first argument
Installation is easy using pip or easy_install.
pip install django-formfield
Add to installed apps
INSTALLED_APPS = (
django-formfield is a form field that accepts a django form as its first argument, and validates as well as render's each form field as expected. Yes a form within a form, within a dream? There are two types of fields available, FormField and ModelFormField. For ModelFormField the data is stored in json format. For FormField data is simply returned as a python dictionary (form.cleaned_data).
from django.db import models
from django import forms
from formfield import ModelFormField
age = forms.IntegerField()
sex = forms.ChoiceField(choices=((1, 'male'), (2, 'female')), required=False)
name = CharField(max_length=200)
meta_info = ModelFormField(PersonMetaForm)
In a hurry? Add it to your Download Basket!
What's New in This Release:
- Fixed bug when a form's initial value evaludated to False
- pep8 related fixes