Skip to content

Vector919/django_dynamic_forms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django Dynamic Forms

django_dynamic_forms is a library that allows you to generate django forms from a dynamic field structure.

Example

from dynamic_forms.forms import DynamicForm
class FieldContaier:
    """
    Super set of all your possible fields for this form.
    """
    user_name = ('user_name', {
        'type': 'CharField',
        'kwargs': {'label': 'User Name'}
    })

    github = ('github_account', {
        'type': 'CharField',
        'kwargs': {'label': 'Github Account', 'required': False}
    })

    gogs = ('gogs_account', {
        'type': 'CharField',
        'kwargs': {'label': 'Github Account', 'required': False}
    })

form_fields = ['user_name', 'password']

form = DynamicForm(form_fields, FieldContainer)
form.to_json() # JSON string representing form (for use in rendering)

About

Create dynamic forms with django!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages