my mistake:
should be
Field('name',gae.StringListProperty() ) #YES
instead of
Field('name',gae.StringListProperty ) #NO
On Apr 5, 11:39 pm, Matt <[email protected]> wrote:
> Just had a quick look into gql.py and yes in the _create method around
> line 214 I've got those lines you mentioned.
>
> I'm running web2py 1.76.5 (2010-03-11 15:19:08) with GAE launcher
> version 1.3.2
>
> Matt
>
> On Apr 6, 4:31 pm, mdipierro <[email protected]> wrote:
>
> > 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.