django-formfield 0.1.3

A form field that accepts a Django form as its first argument

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!

What's new in django-formfield 0.1.3:

  • Fixed bug when a form's initial value evaludated to False
  • pep8 related fixes
Read full changelog
send us
an update
LICENSE TYPE:
The Apache License 2.0 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Jose Soares
HOMEPAGE:
github.com
CATEGORY:
ROOT \ Internet \ Django Plugins
3 django-formfield Screenshots:
django-formfielddjango-formfielddjango-formfield
django-formfield is a form field for Django that accepts a Django form as its first argument.

Installation

Installation is easy using pip or easy_install.

pip install django-formfield

or

easy_install django-formfield

Add to installed apps

INSTALLED_APPS = (
 ...
 formfield,
 ...
)


Getting Started

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).

Example

from django.db import models
from django import forms

from formfield import ModelFormField

class PersonMetaForm(forms.Form):
 age = forms.IntegerField()
 sex = forms.ChoiceField(choices=((1, 'male'), (2, 'female')), required=False)


class Person(models.Model):
 name = CharField(max_length=200)

 meta_info = ModelFormField(PersonMetaForm)

Last updated on February 7th, 2013

requirements

#form field #Django form #Django #form #field #argument

Add your review!

SUBMIT