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 <[email protected]> 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://www.juixe.com/techknow/index.php/2006/06/03/rails-single-table...http://spattendesign.com/2007/12/31/fun-with-single-table-inheritance
>
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---