Richard, I didn't understand your "space reasons", but alias param does not exist today.
Massimo can tell us if it will be implemented. IMHO it is a good idea, mainly for legacy tables, with legacy names. -- Vinicius Assef. On Tue, May 24, 2011 at 12:36 PM, Richard Baron Penman <[email protected]> wrote: > For space reasons I want the database to internally store 'a', but be able > to use the longer name in code for readability. > So I think your example should instead be: > Field('a', 'string', alias='my_descriptive_field_name') > But does that alias parameter exist? Not according to docs: > http://web2py.com/book/default/chapter/06#Record-Representation > > > On Wed, May 25, 2011 at 1:18 AM, Vinicius Assef <[email protected]> > wrote: >> >> I think he is talking about this, if it would be SQL: >> SELECT my_descriptive_name as a FROM my_table >> >> In web2py, something near: >> Field('my_descriptive_field_name', 'string', alias='a') >> >> And, in code: >> print db.my_table.a >> >> -- >> Vinicius Assef. >> >> >> >> On Tue, May 24, 2011 at 11:21 AM, Massimo Di Pierro >> <[email protected]> wrote: >> > How about >> > >> > my_descriptive_field_name = db.a >> > >> > On May 24, 9:06 am, Plumo <[email protected]> wrote: >> >> the database I use (GAE) has a big overhead for long field names. >> >> So I want to change Field('my_descriptive_field_name') to Field('a') >> >> and use >> >> an alias to keep accessing with 'my_descriptive_field_name'. >> >> Can this be done? > >

