vt_list_selector.py 2.63 KB
Newer Older
1 2 3 4
# -*- coding: utf-8 -*-
""" list_selector (virtaul table)

"""
5
FORMATS = ['bib', 'html', 'odt', 'pdf', 'tex']
6

7 8 9 10 11 12 13 14 15 16 17 18
#-------------------------------------------------------------------------------
#
# DEFINITION
#
#-------------------------------------------------------------------------------
virtdb.define_table('list_selector',
    Field('year_start', 'integer', default=year),
    Field('year_end', 'integer'),
    Field('id_teams', 'reference teams', label='Team'),
    Field('id_projects', 'reference projects', label='Project'),
    Field('id_categories', 'reference categories', label='Category'),
    Field('author', 'string'),
19
    Field('id_authors_roles', 'reference authors_roles', label='Role'),
20 21 22
    Field('id_lists', 'reference lists', label='List'),
    Field('format', 'string', default='html'))

23
virtdb.list_selector.id_authors_roles.requires = IS_IN_DB(db, 'authors_roles.role')
24 25 26 27
virtdb.list_selector.id_categories.requires = IS_IN_DB(db, 'categories.code')
virtdb.list_selector.id_lists.requires = IS_IN_DB(db, 'lists.list')
virtdb.list_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.list_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
28
virtdb.list_selector.format.requires = IS_IN_SET(FORMATS)
29 30 31 32 33 34 35 36 37 38 39

#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('list_selector')
fieldsModifier.configure_field('year_start', flex=1)
fieldsModifier.configure_field('year_end', flex=1)
fieldsModifier.merge_fields('year_start', 'year_end', fieldLabel=T('Year'))

40 41
fieldsModifier.configure_field('id_lists', selectFirst=True)

42
fieldsModifier.configure_field('id_authors_roles', emptyText=T('select...'), xtype='xcomboboxuserreset')
43
fieldsModifier.configure_field('id_categories', emptyText=T('select...'), xtype='xcomboboxuserreset')
44
fieldsModifier.configure_field('id_projects', emptyText=T('select...'), xtype='xcomboboxuserreset')
45 46
fieldsModifier.configure_field('id_teams', emptyText=T('select...'), xtype='xcomboboxuserreset')

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#
# GRID CONFIGURATiON
#
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#
# STORE CONFIGURATiON
#
#-------------------------------------------------------------------------------