示例#1
0
class Taxes_TableResource(OrderedTable):

    class_id = 'shop-taxes'
    class_title = MSG(u'Taxes')
    class_handler = Taxes_TableHandler

    table_actions = [
        OrderUpButton, OrderDownButton, OrderTopButton, OrderBottomButton
    ]
    view = OrderedTable_View(table_actions=table_actions)
示例#2
0
class ShopForm(OrderedTable):

    class_id = 'shop-form'
    class_title = MSG(u'Shop form')
    class_version = '20090609'
    class_handler = ShopFormTable
    class_views = ['display', 'edit', 'view', 'add_record']

    display = ShopForm_Display()
    view = OrderedTable_View(search_template=None, access='is_admin')
    edit = AutomaticEditView()

    add_product = AddProduct_View()

    form = [
        TextWidget('name', title=MSG(u'Name')),
        TextWidget('title', title=MSG(u'Title')),
        BooleanCheckBox('mandatory', title=MSG(u'Mandatory')),
        BooleanCheckBox('multiple', title=MSG(u'Multiple')),
        SelectWidget('datatype', title=MSG(u'Data Type')),
        SelectWidget('widget', title=MSG(u'Widget')),
    ]

    edit_widgets = [
        TextWidget('submit_value', title=MSG(u'Submit value')),
        TextWidget('to_addr', title=MSG(u'To addr')),
        RTEWidget('introduction', title=MSG(u'Introduction')),
        RTEWidget('final_message', title=MSG(u'Final message')),
        BooleanRadio('must_be_authentificated',
                     title=MSG(u'Must be authentificated to see form'))
    ]

    edit_schema = {
        'submit_value': Unicode(multilingual=True, mandatory=True),
        'to_addr': Email(mandatory=True),
        'introduction': XHTMLBody(multilingual=True),
        'final_message': XHTMLBody(multilingual=True),
        'must_be_authentificated': Boolean
    }

    @classmethod
    def get_metadata_schema(cls):
        return merge_dicts(OrderedTable.get_metadata_schema(), cls.edit_schema)