Does db.person.courses.represent(person.coures) work? See
http://web2py.com/book/default/chapter/06#Many-to-Many,-list:<type>,-and-contains
.
Anthony
On Saturday, August 20, 2011 1:58:04 PM UTC-4, fishwebby wrote:
> Hi, I'm trying to do something quite straightforward but can't seem to
> work out how to do it: for a list:reference field, get all the items
> in the reference field (not just their IDs).
>
> For example, a person with many courses:
>
> db.define_table('course', Field('title'))
>
> db.define_table('person',
> Field('name'),
> Field('courses', 'list:reference course'))
>
> First I'm finding a person by ID:
>
> person = db(db.person.id==id).select().first()
>
> Then I want to get a list of courses - "person.courses" just returns a
> list of IDs. I could use "belongs" with those IDs but I believe that
> has a limit of 30 on GAE so I can't use that.
>
> Is there some way of selecting the objects in the reference, something
> like
>
> db(person.courses).select() ?