web2py.gluon.sqlhtml

Package web2py :: Package gluon :: Module sqlhtml |
[hide private]
[frames] | no frames]

# Module sqlhtml

source code

    This file is part of the web2py Web Framework
    Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
    License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)

    Holds:

    - SQLFORM: provide a form for a table (with/without record)
    - SQLTABLE: provides a table for a set of records
    - form_factory: provides a SQLFORM for an non-db backed table

Classes | [hide private]
| FormWidget helper for SQLFORM to generate form input fields (widget), related to the fieldtype
| StringWidget
| IntegerWidget
| DoubleWidget
| DecimalWidget
| TimeWidget
| DateWidget
| DatetimeWidget
| TextWidget
| BooleanWidget
| OptionsWidget
| ListWidget
| MultipleOptionsWidget
| RadioWidget
| CheckboxesWidget
| PasswordWidget
| UploadWidget
| AutocompleteWidget
| SQLFORM SQLFORM is used to map a table (and a current record) into an HTML form given a SQLTable stored in db.table generates an insert form:: SQLFORM(db.table) generates an update form:: record=db.table[some_id] SQLFORM(db.table, record) generates an update with a delete button:: SQLFORM(db.table, record, deletable=True) if record is an int:: record=db.table[record] optional arguments: :param fields: a list of fields that should be placed in the form, default is all.
| SQLTABLE given a Rows object, as returned by a db().select(), generates an html table with the rows.

Functions | [hide private]
trap_class(_class=global_settings.applications_parent, trap=True) | source code
represent(field, value, record) | source code
safe_int(x) | source code
safe_float(x) | source code
form_factory(*fields, **attributes) generates a SQLFORM for the given fields. | source code

Variables | [hide private]
| table_field = `re.compile(r'`[`\w_`]``+`\.`[`\w_`]``+`')`
| widget_class = `re.compile(r'^\w`*`')`

Function Details | [hide private]

### form_factory(*fields, **attributes) Static Method | source code
generates a SQLFORM for the given fields. Internally will build a non-database based data model to hold the fields.