I am sure there are better ways of doing it,  but I usually look to
see exactly what is printed in the console by placing a print
statement in my code, something like one of these:

print companies
print BEAUTIFY(companies)
for company in companies: print company

this gives me a clue as to how to address the variables.

Regards,
-D

On Nov 24, 9:58 am, Ole Martin Maeland <olemael...@gmail.com> wrote:
> Hi,
>
> That will not work. I just read the output from dict - companies - that is a
> query on db.newcomp. So only keys in dict will be the database names - id,
> uuid, address. It works for id and uuid, but not for name and address. state
> that it is not defined, but it's in the db, it's in the db model. so it's
> something else...
>
> but I have no idea..
>
> regards
> Ole Martin
>
> def list_companies():
>     form=crud.create(db.newcomp)
>     companies=db(db.newcomp.id>0).select(orderby=db.newcomp.id)
>     return dict(companies=companies,form=form)
>
> 2010/11/19 Kenneth Lundström <kenneth.t.lundst...@gmail.com>
>
>
>
> > > {{for company in companies:}}
> > > <tr>
> > > <td>{{=uuid}}</td>
> > > <td>{{=address}}</td>
> > > </tr>
> > >{{pass}}
>
> > Shouldn´t this be like
>
> > <td>{{=company.uuid}}</td>
> > <td>{{=company.address}}</td>
>
> > or maybe
>
> > <td>{{=companies[company].uuid}}</td>
> > <td>{{=campanies[company].address}}</td>
>
> > Kenneth
>
> --
> Hilsen
> Ole Martin
> Mob: 95227471

Reply via email to