Can you help testing polymodel? In trunk:

db=DAL('gae')
db.define_table('contact',Field('address'), polymodel=True)
db.define_table('person',Field('first_name'), polymodel=db.contact)
db.define_table('company',Field('business_name'),
polymodel=db.contact)

db.person.insert(first_name="John", address="here')
db.company.insert(business_name="John Inc", address="there')
contacts = db(db.contact.id>0).select() # should lists both persons
and conpanies

Massimo


On Sep 2, 11:07 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I agree that polymodel would be trivial. We would only need to decide
> how to pass parameters to db.define_table to determine if a table is a
> polymodel or extends an existing one. This would not have an
> equivalent in SQL.
>
> On Sep 2, 10:40 am, Dave <thefe...@gmail.com> wrote:
>
> > I'm new to Web2py and trying to get a sense for its GAE support,
> > beyond the basic "RDBMS-like" functions (which Web2py seems to support
> > very well!)
>
> > Expando models and PolyModel:  Is there any way to use either of these
> > with the DAL currently?  Are there plans to, if not?  PolyModel
> > especially seems like it wouldn't be too difficult to add, as it can
> > be used identically to the default Model class (all of its magic is
> > handled under the hood I think.)
>
> > Thanks for the information, and the great work so far.  I'm really
> > impressed with how easy web2py is to develop with.

Reply via email to