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

Class TabForm

source code


Render forms within a QTabWidget:

from = TabForm([('First tab', ['title', 'short_description']),
                ('Second tab', ['director', 'release_date'])])
../_static/form/tab_form.png
Instance Methods
 
__init__(self, tabs, position='North')
eg : with 2 columns, the fields ['street', 'city', 'country'] will be ordered as :
source code
 
__unicode__(self) source code
 
add_tab_at_index(self, tab_label, tab_form, index)
Add a tab to the form at the specified index
source code
 
add_tab(self, tab_label, tab_form)
Add a tab to the form
source code
 
get_tab(self, tab_label)
modify the underlying tab_form in case of inheritance
source code
 
replaceField(self, original_field, new_field)
Replace a field on this form with another field. This function can be used to modify inherited forms.
source code
 
render(*args, **kwargs)
of (label, widget editor)
source code

Inherited from Form: add_field, get_fields, removeField

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  NORTH = 'North'
  SOUTH = 'South'
  WEST = 'West'
  EAST = 'East'
Properties

Inherited from object: __class__

Method Details

__init__(self, tabs, position='North')
(Constructor)

source code 

eg : with 2 columns, the fields ['street', 'city', 'country'] will be ordered as :

street

city

country

 
Parameters:
  • tabs - a list of tuples of (tab_label, tab_form)
  • position - the position of the tabs with respect to the pages
Overrides: object.__init__

__unicode__(self)

source code 
Overrides: Form.__unicode__

add_tab_at_index(self, tab_label, tab_form, index)

source code 
Add a tab to the form at the specified index
Parameters:
  • tab_label - the name to the tab
  • tab_form - the form to display in the tab or a list of field names.
  • index - the position of tab in the tabs list.

add_tab(self, tab_label, tab_form)

source code 
Add a tab to the form
Parameters:
  • tab_label - the name of the tab
  • tab_form - the form to display in the tab or a list of field names.

get_tab(self, tab_label)

source code 
Get the tab form of associated with a tab_label, use this function to
modify the underlying tab_form in case of inheritance

:param tab_label : a label of a tab as passed in the construction method :return: the tab_form corresponding to tab_label

replaceField(self, original_field, new_field)

source code 

Replace a field on this form with another field. This function can be used to modify inherited forms.

:param original_field : the name of the field to be replace :param new_field : the name of the new field :return: True if the original field was found and replaced.

Overrides: Form.replaceField
(inherited documentation)

render(*args, **kwargs)

source code 
of (label, widget editor)
Parameters:
  • widgets - a dictionary mapping each field in this form to a tuple
Returns:
a QWidget into which the form is rendered
Decorators:
  • @gui_function
Overrides: Form.render
(inherited documentation)