db.define_table('fruits',
Field('name', type='string'),
format='%(name)s')
db.define_table('cake',
Field('name', type='string'),
Field('fruit', 'reference fruits', requires = IS_IN_DB(db, db.fruits.id, '%(name)s'), represent=lambda id, r: db.fruits[id].name))
grid=SQLFORM.grid(db.cake)
{{=grid}}
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
db.define_table('config',
Field('co_code', type = 'string', length = 256 ,label = T('Code')),
Field('co_organization','reference organizations' ,label = T('Organization')),
Field('co_value', type = 'string', length = 256 ,label = T('Value')),
Field('co_area', type = 'string', length = 256 ,label = T('Area')),
Field('co_note',type = 'text' ,label = T('Note')),
Field('co_access_level',type = 'integer'),
migrate = settings.migrate,
fake_migrate=settings.fake_migrate,
)
db.config.represent = lambda v, r: T(db.config[v].co_note)
db.config.represent = lambda v, r: T(db.config[v].co_note)
db.config.co_note.represent = lambda v, r: T(v)
Hello,Is is possible translate a data in a SQLFORM?Where my controller is:form=SQLFORM(db.cake)And my view:{{=form}}
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
Hi Anthony, actually I just want to translate the form on my view, like my view was {{=T(form)}}.