This is fixed in trunk. Which version of web2py are you using?

On Aug 19, 2:15 pm, Johann Spies <[email protected]> wrote:
> The model:
> db.define_table("gr01",
>                 Field("service_provider", db.service_provider,
>                       requires=IS_IN_DB(db,db.service_provider.id, 
> '%(name)s')),
>                 Field("trainer",'list:reference db.trainer',
>                       requires=IS_IN_DB(db,db.trainer.id, '%(name)s,
> %(surname)s'),
>                       label="Trainer(s)",
>                       ),
>                 Field("focus"),
>                 Field("date","date"),
>                 Field("length_of_event", "integer"),
>                 Field("comments","text"),
>                 Field("planned","integer",label="PLANNED ATTENDEES"),
>                 Field("actual","integer",label="ACTUAL ATTENDEES"),
>                 )
>
> Using appadmin I can add records, but when doing a query which
> involves 'trainer', the following happens:
>
> l = db(db.gr01.id>0).select()
>
> Traceback (most recent call last):
>   File "<input>", line 1, in <module>
>   File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 3228, in select
>     return self.parse(db, rows, self.colnames, SetClass=Set)
>   File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 3332, in parse
>     colset[fieldname] = [int(x) for x in value.split('|') if x.strip()]
> AttributeError: 'int' object has no attribute 'split'
>
> What am I doing wrong?
>
> Regards
> Johann
> --
>     "Be not deceived; God is not mocked: for whatsoever a
>      man soweth, that shall he also reap."
>                                   Galatians 6:7

Reply via email to