Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

web app forms tools

Project Description
btform
=======

python web app forms tools

Code is extracted from web.py

install
=======

easy_install btform

pip install btform

example of flask
=================

#!/usr/bin/env python
#coding:utf-8

from flask import Flask
from flask import request
from btform import rules
import btform as form

app = Flask(__name__)

form1 = form.Form(
form.Textbox("name",rules.is_alphanum2(6,32),description=""),
form.Password("passwd",rules.is_alphanum2(6,32),description=""),
form.Textarea("desc",rules.len_of(1,128),description="",rows="5",),
form.Button("submit", type="submit",html="<b>submit</b>"),
)

def render_form(frm):
return "<form action='/' method='POST'>%s</form>"%frm.render()

@app.route('/', methods=['POST', 'GET'])
def hello_world():
iform = form1()
if request.method == 'GET':
return render_form(iform)
elif request.method == 'POST':
if not iform.validates(source=request.form):
return render_form(iform)
else:
return "ok"

if __name__ == '__main__':
app.run()
Release History

Release History

This version
History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
btform-0.1.linux-x86_64.tar.gz (16.2 kB) Copy SHA256 Checksum SHA256 any Dumb Binary Sep 16, 2015
btform-0.1-py2-none-any.whl (10.6 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Sep 16, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting