Skip to content

A Django library for defining HTML building blocks (e.g., forms, form fields, tables) that can be easily rendered into HTML.

Notifications You must be signed in to change notification settings

setaris/django-bigfoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

=============================================== django-bigfoot - HTML building block for Django

Currently a work in progress. Please email us if you're intersted in using it.

django-bigfoot makes helps define HTML building blocks (e.g., forms, form fields, tables) that can be easily be combined and rendered into HTML.

What do I want that for?!

Let's say you want to display a formset as a table. You already have a defined style for your form fields that shows errors just like you want 'em. Well, with bigfoot, you define a template for your form field, a template for a form (probably just the form tag), and a template for a table. Then you do this:

def my_view(request):
    formset = formset_factory(...)
    bigfoot_form = Form(
        Table(formset, {
            'description': FormField(A(), 'description'),
            'amount': FormField(A(), 'amount')
        })
    return render('template.html', {'elements': bigfoot_form})

Here's template.html:

<html>
    <head></head>
    <body>{{ elements }}</body>
</html>

Yep, that's all.

About

A Django library for defining HTML building blocks (e.g., forms, form fields, tables) that can be easily rendered into HTML.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages