All Projects → Pylons → Deform

Pylons / Deform

Licence: other
A Python HTML form library.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deform

Ng Dynamic Forms
Rapid form development library for Angular
Stars: ✭ 1,146 (+221.01%)
Mutual labels:  forms, bootstrap
Ngx Formly
JSON powered / Dynamic forms for Angular
Stars: ✭ 2,109 (+490.76%)
Mutual labels:  forms, bootstrap
Cookiecutter Pyramid Talk Python Starter
An opinionated Cookiecutter template for creating Pyramid web applications starting way further down the development chain. This cookiecutter template will create a new Pyramid web application with email, sqlalchemy, rollbar, and way more integrated.
Stars: ✭ 64 (-82.07%)
Mutual labels:  pyramid, bootstrap
Coreui Vue
Over 90 Bootstrap based Vue.js components and directives. CoreUI React.js UI Components. CoreUI for Vue.js replaces and extends the Bootstrap javascript. Components have been built from scratch as true Vue components, without jQuery and unneeded dependencies.
Stars: ✭ 318 (-10.92%)
Mutual labels:  bootstrap
Jetstrap
A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.
Stars: ✭ 320 (-10.36%)
Mutual labels:  bootstrap
Bootstrap Iconpicker
A simple icon picker
Stars: ✭ 344 (-3.64%)
Mutual labels:  bootstrap
Bootstrap 4 Login Page
Bootstrap 4 Login Page Template
Stars: ✭ 352 (-1.4%)
Mutual labels:  bootstrap
Vue Flow Form
Create conversational conditional-logic forms with Vue.js.
Stars: ✭ 315 (-11.76%)
Mutual labels:  forms
File Upload With Preview
🖼 A simple file-upload utility that shows a preview of the uploaded image. Written in pure JavaScript. No dependencies. Works well with Bootstrap 4 or without a framework.
Stars: ✭ 352 (-1.4%)
Mutual labels:  bootstrap
Formous
Simple and elegant form-handling for React - ABANDONWARE
Stars: ✭ 335 (-6.16%)
Mutual labels:  forms
A11y styled form controls
Various styled accessible form controls
Stars: ✭ 335 (-6.16%)
Mutual labels:  forms
Wondercms
WonderCMS - fast and small flat file CMS (5 files)
Stars: ✭ 330 (-7.56%)
Mutual labels:  bootstrap
Formik Persist
💾 Persist and rehydrate a Formik form to localStorage
Stars: ✭ 345 (-3.36%)
Mutual labels:  forms
Reagent Forms
Bootstrap form components for Reagent
Stars: ✭ 325 (-8.96%)
Mutual labels:  forms
Angular Admin
🔏Admin client for surmon.me blog powered by @angular and Bootstrap4
Stars: ✭ 352 (-1.4%)
Mutual labels:  bootstrap
Roncoo Adminlte
RonCoo AdminLTE --是一个完全响应式的免费开源后台管理模板。基于 AdminLTE 框架(后续会随着版本更新而更新);使用jQuery 2.2.3版本,并引入很多优秀的第三方jQuery插件,开发者也可以改用自己熟悉的第三方插件,易于使用,并高度可定制,适合许多屏幕分辨率从小型移动设备到大型台式机,这是国内的开源模板未支持的。
Stars: ✭ 320 (-10.36%)
Mutual labels:  bootstrap
Bootstrap Suggest Plugin
这是一个基于 bootstrap 按钮式下拉菜单组件的搜索建议插件,必须使用于按钮式下拉菜单组件上。
Stars: ✭ 350 (-1.96%)
Mutual labels:  bootstrap
Maroto
A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple.
Stars: ✭ 334 (-6.44%)
Mutual labels:  bootstrap
Dark Mode Switch
Add a dark-mode theme toggle with a Bootstrap Custom Switch
Stars: ✭ 332 (-7%)
Mutual labels:  bootstrap
Next.js Typescript Starter Kit
🌳 [email protected], Styled-jsx, TypeScript, Jest, SEO
Stars: ✭ 342 (-4.2%)
Mutual labels:  bootstrap

Deform

.. image:: https://github.com/Pylons/deform/workflows/Build%20and%20test/badge.svg?branch=main :target: https://github.com/Pylons/deform/actions?query=workflow%3A%22Build+and+test%22+branch%3Amain :alt: Build Status

.. image:: https://img.shields.io/pypi/v/deform :target: https://pypi.org/project/deform/ :alt: Current Release

.. image:: https://readthedocs.org/projects/deform/badge/?version=main :target: https://docs.pylonsproject.org/projects/deform/en/main/ :alt: Main Documentation Status

.. image:: https://readthedocs.org/projects/deform/badge/?version=latest :target: https://docs.pylonsproject.org/projects/deform/en/latest/ :alt: Latest Documentation Status

.. image:: https://img.shields.io/pypi/pyversions/deform :alt: Python Support

.. contents:: :local:

Introduction

Deform is a Python form library for generating HTML forms on the server side. Date and time picking widgets <https://deformdemo.pylonsproject.org/datetimeinput/>, rich text editors <https://deformdemo.pylonsproject.org/richtext/>, forms with dynamically added and removed items <https://deformdemo.pylonsproject.org/sequence_of_mappings/>_ and a few other complex use cases <https://deformdemo.pylonsproject.org/>_ are supported out of the box.

Deform integrates with the Pyramid web framework <https://trypyramid.com/>_ and several other web frameworks. Deform comes with Chameleon templates <https://chameleon.readthedocs.io/en/latest/>_ and Bootstrap 3 <https://getbootstrap.com/docs/3.3/>_ styling. Under the hood, Colander schemas <https://github.com/Pylons/colander>_ are used for serialization and validation. The Peppercorn <https://github.com/Pylons/peppercorn>_ library maps HTTP form submissions to nested structure.

Although Deform uses Chameleon templates internally, you can embed rendered Deform forms into any template language.

Use cases

Deform is ideal for complex server-side generated forms. Potential use cases include:

  • Complex data entry forms

  • Administrative interfaces

  • Python based websites with high amount of data manipulation forms

  • Websites where additional front end framework is not needed

Installation

Install using pip and Python package installation best practices <https://packaging.python.org/tutorials/installing-packages/>_::

pip install deform

Example

See all widget examples <https://deformdemo.pylonsproject.org>. Below is a sample form loop using the Pyramid <https://trypyramid.com/> web framework.

.. image:: https://github.com/Pylons/deform/raw/main/docs/example.png :width: 400px

Example code:

.. code-block:: python

"""Self-contained Deform demo example."""
from __future__ import print_function

from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.httpexceptions import HTTPFound

import colander
import deform


class ExampleSchema(deform.schema.CSRFSchema):

    name = colander.SchemaNode(
        colander.String(),
        title="Name")

    age = colander.SchemaNode(
        colander.Int(),
        default=18,
        title="Age",
        description="Your age in years")


def mini_example(request):
    """Sample Deform form with validation."""

    schema = ExampleSchema().bind(request=request)

    # Create a styled button with some extra Bootstrap 3 CSS classes
    process_btn = deform.form.Button(name='process', title="Process")
    form = deform.form.Form(schema, buttons=(process_btn,))

    # User submitted this form
    if request.method == "POST":
        if 'process' in request.POST:

            try:
                appstruct = form.validate(request.POST.items())

                # Save form data from appstruct
                print("Your name:", appstruct["name"])
                print("Your age:", appstruct["age"])

                # Thank user and take him/her to the next page
                request.session.flash('Thank you for the submission.')

                # Redirect to the page shows after succesful form submission
                return HTTPFound("/")

            except deform.exception.ValidationFailure as e:
                # Render a form version where errors are visible next to the fields,
                # and the submitted values are posted back
                rendered_form = e.render()
    else:
        # Render a form with initial default values
        rendered_form = form.render()

    return {
        # This is just rendered HTML in a string
        # and can be embedded in any template language
        "rendered_form": rendered_form,
    }


def main(global_config, **settings):
    """pserve entry point"""
    session_factory = UnencryptedCookieSessionFactoryConfig('seekrit!')
    config = Configurator(settings=settings, session_factory=session_factory)
    config.include('pyramid_chameleon')
    deform.renderer.configure_zpt_renderer()
    config.add_static_view('static_deform', 'deform:static')
    config.add_route('mini_example', path='/')
    config.add_view(mini_example, route_name="mini_example", renderer="templates/mini.pt")
    return config.make_wsgi_app()

This example is in deformdemo repository <https://github.com/Pylons/deformdemo/>_. Run the example with pserve::

 pserve mini.ini --reload

Status

This library is actively developed and maintained. Deform 2.x branch has been used in production on several sites since 2014. Automatic test suite has 100% Python code coverage and 500+ tests.

Projects using Deform

  • Websauna <https://websauna.org/>_

  • Kotti <http://kotti.pylonsproject.org/>_

  • Substance D <http://www.substanced.net/>_

Community and links

  • Widget examples <https://deformdemo.pylonsproject.org>_

  • PyPI <https://pypi.org/project/deform/>_

  • Issue tracker <https://github.com/Pylons/deform/issues>_

  • Widget examples repo <https://github.com/Pylons/deformdemo/>_

  • Documentation <https://docs.pylonsproject.org/projects/deform/en/latest/>_

  • Support <https://pylonsproject.org/community-support.html>_

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].