odd. The code there says:

            if isinstance(field.type, gluon.sql.SQLCustomType):
                ftype = self._db._translator[field.type.native or
field.type.type](**attr)
            elif isinstance(field.type, gae.Property):
                ftype = field.type
            elif field.type[:2] == 'id':
                continue

since field.type is, in your case,  gaeStringListProperty and it
extends gae.Property the previous elif should have been True. It is
for me.
Do you have those lines? What GAE version?



On Apr 5, 11:19 pm, Matt <mjwat...@gmail.com> wrote:
> Thanks for your prompt response :)
>
> Trying your example:
>
> from gluon.contrib.gql import gae
>
> db.define_table('example',
>     db.Field('title', 'string'),
>     db.Field('name', gae.StringListProperty))
>
> as a quick test but I'm getting an error:
>
> Traceback (most recent call last):
>   File "/Apps/web2py/testing/gluon/restricted.py", line 173, in
> restricted
>     exec ccode in environment
>   File "/Apps/web2py/testing/applications/init/models/db_tables.py",
> line 55, in <module>
>     db.Field('name', gae.StringListProperty))
>   File "/Apps/web2py/testing/gluon/contrib/gql.py", line 128, in
> define_table
>     t._create()
>   File "/Apps/web2py/testing/gluon/contrib/gql.py", line 216, in
> _create
>     elif field.type[:2] == 'id':
> TypeError: 'type' object is unsubscriptable
>
> What am I doing wrong here?
>
> Thanks,
> Matt
>
> On Apr 6, 3:43 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > For example:
>
> > from gluon.contrib.gql import gae
>
> > db.define_table('tablename',....,Field('name',gae.StringListProperty),....)
>
> > You can use any native type but forms may not work because you have to
> > make sure you insert the corresponding type (in the example a list of
> > strings). Sorry there is not much documentation about this.
>
> > Massimo
>
> > On Apr 5, 10:34 pm, Matt <mjwat...@gmail.com> wrote:
>
> > > Hi there,
>
> > > In the "features not in the book section" it lists since version
> > > 1.74.5
>
> > > * support for all native types on GAE (e.g. StringListProperty)
>
> > > Are there any examples demonstrating the use of these available?
>
> > > Thanks,
> > > Matt

-- 
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