Changes between Version 7 and Version 8 of DeveloperGuidelines/Internationalisation


Ignore:
Timestamp:
07/29/09 02:00:11 (16 years ago)
Author:
Fran Boon
Comment:

field_type no table

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Internationalisation

    v7 v8  
    1212To make dropdown options localisable, use this pattern:
    1313{{{
    14 module_table_field_opts = {
     14module_field_type_opts = {
    1515    1:T('Option1'),
    1616    2:T('Option2'),
    1717    3:T('Option3')
    1818    }
    19 opt_module_field = SQLTable(None, 'opt_module_field',
    20                     db.Field('field', 'integer', notnull=True,
    21                     requires = IS_IN_SET(module_table_field_opts),
     19opt_module_field_type = SQLTable(None, 'opt_module_field_type',
     20                    db.Field('field_type', 'integer', notnull=True,
     21                    requires = IS_IN_SET(module_field_type_opts),
    2222                    default = 1,
    23                     represent = lambda opt: opt and module_table_field_opts[opt]))
     23                    represent = lambda opt: opt and module_field_type_opts[opt]))
    2424
    2525db.define_table(table,
    26                opt_module_field,
     26               opt_module_field_type,
    2727               ...
    2828               )