It was a toy example. this will not be in web2py. As far as the book goes, I will see what I can do.
Massimo On Jul 30, 9:32 pm, Jonathan Lundell <jlund...@pobox.com> wrote: > On Jul 30, 2010, at 7:22 PM, Iceberg wrote: > > > > > On Jul 31, 1:15 am, Jonathan Lundell <jlund...@pobox.com> wrote: > >> On Jul 30, 2010, at 9:19 AM, VP wrote: > >>> On Jul 30, 9:35 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > >>>>http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/ > > >>> This is really nice. Please do more of this. > > >> My initial reaction is the opposite. The result might be more readable, > >> but it doesn't strike me as more writable. > > >> What would be most helpful for me would be a deeper explanation (in the > >> book) of what's going on behind the existing DAL "magic" syntax, rather > >> than adding yet another layer of magic. > > > You make a good point, Jonathan. And I think there is a underlying > > question here. Which kind of audience is web2py targeting to? If for > > developers, the existing DAL syntax is already powerful and magical > > enough (the document is also good, here it > > is.http://web2py.com/book/default/chapter/06 > > ). Developers don't need another layer which is more fancy but not > > more powerful. > > I'm not satisfied with the treatment in the book. I'd like to see each of the > DAL objects more completely described, especially as to the underlying Python > types and the operations that they implicitly support. Several of them IIRC > are polymorphic wrt their argument types, and you either have to divine this > telepathically or read the source in detail. Likewise operator overloading. > > I'm sure it's second nature to Massimo, but for most of us, we have to hunt > around for an example that matches our situation, and blindly copy & paste. > Either that or experiment until it stops raising exceptions....