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

<http://web2py.com/book/default/chapter/06#Record-Representation>

On Wed, May 25, 2011 at 1:18 AM, Vinicius Assef <vinicius...@gmail.com>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
> <massimo.dipie...@gmail.com> wrote:
> > How about
> >
> > my_descriptive_field_name = db.a
> >
> > On May 24, 9:06 am, Plumo <richar...@gmail.com> 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?
>

Reply via email to