Would be great....

This solution works great... but it's not accessible in the modules
files, because dog is not visible there...



On 14 jan, 15:21, Massimo Di Pierro <[email protected]>
wrote:
> eventually we shoud have a way to remap table and field names that was
> one of the main reason for rewriting the dal.
>
> On Jan 10, 10:51 am, MarcelloParra<[email protected]> wrote:
>
>
>
>
>
>
>
> > Hello Massimo and all,
>
> > I'm trying to use web2py for several projects of mine.
> > I always find a problem that should be solved if I could set the table name.
>
> > Let me show an example...
>
> > Suppose that I have this:
>
> > db.define_table('person12345', Field('name'))
> > db.define_table('dog12345', Field('name'), Field('owner', db.person))
>
> > person12345 and dog12345 are names of the tables.
> > As they are already running projects, I can't change them...
>
> > If I don't want to call a dog, dog12345 all the time, I could do this:
>
> > person=db.define_table('person12345', Field('name'))
> > dog=db.define_table('dog12345', Field('name'), Field('owner', db.person))
>
> > This should work fine.
>
> > But I can't do this:
> > person[1].dog.select()
>
> > This should just work with:
> > person[1].dog12345.select()
>
> > Is there a way to do this ?
>
> > Thanks...

Reply via email to