On a second thought.... this is not quite the same of what the link
says.

My example defines 6 different tables.

The link you send seems to suggest building a single table with unused
fields. web2py does not allow that and I would not consider it very
clean.

Massimo


On Jan 14, 2:32 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> yes. and it actually supports mutliple table inheritance
>
> single inheritance
>
> db.define_table('player',db.Field('name'))
> db.define_table('footballer',db.player,db.Field('club'))
> db.define_table('cricketer',db.player,db.Field
> ('batting_average','integer'))
> db.define_table('bowler',db.cricketer,db.Field
> ('bowling_average','integer'))
>
> multiple inheritance
>
> db.define_table('married',db.Field('companion_name'))
> db.define_table('married_bowler',db.bowler,db.married)
>
> too bad this is not yet documented anywhere. Perhaps you could help us
> by writing somehting about it.
>
> Massimo
>
> On Jan 14, 1:42 am, Fran <francisb...@googlemail.com> wrote:
>
> > Does Web2Py support his?
> > - it certainly looks very useful...
>
> >http://martinfowler.com/eaaCatalog/singleTableInheritance.html
>
> > Examples of this in 
> > Rails:http://wiki.rubyonrails.org/rails/pages/singletableinheritancehttp://...
>
> > I do /some/ of this already following the T2 style of defining a base
> > table type (T2 calls this 'trackable') & then extending this in the
> > model with resource-specific fields.
> > This gives me DRYness but doesn't mean that I can do a search of all
> > sub-tables without a JOIN...
>
> > Many thanks,
> > Fran.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to