Skip to content
Snippets Groups Projects
Commit 76783f83 authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Introduce the mapper module.

parent 2df848d7
No related branches found
No related tags found
No related merge requests found
""" $Id$
"""
__version__ = "$Revision$"
__author__ = "R. Le Gac"
def map_default(fields):
"""Map a list of field in the Ext.form.formPanel
Return the items list for the Ext.form.FormPanel.
"""
return fields
def map_tabpanel(fieldsets):
"""Map a list of fieldsets on a Ext.TabPanel.
A tab is associated to each fieldset.
the name of the tab is the name of the fieldset.
Return the items list for the Ext.form.FormPanel.
"""
tabpanel = {'activeTab': 0,
'defaults': {'anchor': '100%'},
'items': [],
'xtype': 'tabpanel'}
for fieldset in fieldsets:
title = fieldset['title']
del fieldset['title']
tab = {'border': False,
'collapsible': False,
'items': fieldset,
'title': title}
tabpanel['items'].append(tab)
return [tabpanel]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment