I agree. I think there should be a web2py type that merges the
functionalities of ListProperty on GAE and IS_IN_SET(multiple=True)

On Jan 3, 11:52 am, Yarko Tymciurak <resultsinsoftw...@gmail.com>
wrote:
> This is directly obvious, but I will state it anyway:
>
> On Dec 30 2009, 1:17 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > I changed this. It was UGLY.
>
> > Now you can do:
>
> >     from gluon.contrib.gql import gae
> >     db.define_table('person',Field('names',gae.StringListProperty()))
>
> for a DAL (abstraction layer), this is tied to _one_ persistence store
> (the string method was not).
>
> The good part of this (from a programmer's perspective) is that it is
> explicit - you know "StingListProperty" is intended to be a gae thing;
>
> The bad part:  it erodes the concept of portability, the prime goal of
> DAL ...
>
> It may be useful for the moment, but there is a design tension which
> is begging for a more comfortable resolution ...
>
>
>
> > and you can do:
>
> >     db.person.insert(names=['Massimo','Max'])
> >     db(db.person.names=='Massimo').select()
>
> > So you can use any native google type AND you can make your own.
>
> Perhaps  you can say a little more on "... and  you can make your
> own."?
>
> Thanks,
> - Yarko
>
>
>
>
>
> > Massimo
>
> > On Dec 30, 12:50 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > There are many GAE types that one may want to use. Today I needed
> > > StringListProperty so I extended the web2py GAE apy so that you can
> > > have a field of type
>
> > > db.define_table('person',Field('names','.StringListProperty()'))
>
> > > and you can do
>
> > > db.person.insert(names=['Massimo','Max'])
> > > db(db.person.names=='Massimo').select()
>
> > > Basically you can put any native type as a web2py type just put it in
> > > a string and start it with a '.'. You can also pass arguments this
> > > way.
>
> > > It is ugly but works.  It is ugly because I'd rather pass an object
> > > than a string. It works because a type has to be a string. It is
> > > experimental because when the new DAL comes this should be replaced by
> > > a better API. This will not stay backward compatible.
>
> > > Massimo- Hide quoted text -
>
> - Show quoted text -

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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