Mind you can also do:
person=db.Table('person',SQLField('name'))
db.define_table('doctor',person,SQLField('specialty'))
On Jun 28, 10:40 am, phecker <[email protected]> wrote:
> Hello,
>
> I would like to share some web2py code snippets about making model
> definitions reusable and allowing to manage user-defined fields.
>
> First the model definition is swapped out to functions, which are used
> in the db.define_table statement. So model-definitions are composed of
> what I call a "table content types".
>
> You can find the corresponding code in my blog:
>
> =>http://phecker65.blogspot.com/2009/06/wiederverwendbare-und.html
>
> Second each table can easily be extended by storing extra fields in a
> meta definition table.
>
> =>http://phecker65.blogspot.com/2009/06/wiederverwendbare-und_26.html
>
> Hope you like it
>
> _peter_
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---