I changed this. It was UGLY. Now you can do:
from gluon.contrib.gql import gae db.define_table('person',Field('names',gae.StringListProperty())) 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. 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 -- 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.