Package Camelot :: Package camelot :: Package view :: Module forms
[frames] | no frames]

Module forms

source code

Classes to layout fields on a form. These are mostly used for specifying the form_display attribute in Admin classes, but they can be used on their own as well. Form classes can be used recursive.
Classes
  Form
Base Form class to put fields on a form. A form can be converted to a QT widget by calling its render method. The base form uses the QFormLayout to render a form:
  Label
Render a label with a QLabel
  TabForm
Render forms within a QTabWidget:
  HBoxForm
Render different forms in a horizontal box:
  VBoxForm
Render different forms or widgets in a vertical box:
  ColumnSpan
  GridForm
Put different fields into a grid, without a label. Row or column labels can be added using the Label form:
  WidgetOnlyForm
Renders a single widget without its label, typically a one2many widget
  GroupBoxForm
Renders a form within a QGroupBox:
Functions
 
structure_to_form(structure)
Convert a python data structure to a form, using the following rules :
source code
Variables
  logger = logging.getLogger('camelot.view.forms')
  __package__ = 'Camelot.camelot.view'
Function Details

structure_to_form(structure)

source code 

Convert a python data structure to a form, using the following rules :

  • if structure is an instance of Form, return structure
  • if structure is a list, create a Form from this list

This function is mainly used in the Admin class to construct forms out of the form_display attribute