On Apr 1, 3:24 pm, "james c." <james.cryp...@gmail.com> wrote:
> This is probably simple but I can't find in the documentation or
> recognize anything posted on this. I have a primary database including
> fields which entries must be members of other databases - this is
> enforced through the primary database definition and select lists
> entry for the enforced membership fields: as recommended by the
> current manual. I must display the information entered on existing and
> later pages. Within the primary database the items entered through
> selected drop down lists appear as index which mean nothing to an end
> user. I can retrieve the  indexed items by using something like in the
> controller/function:
>
> current_customer_name =
> db(db.customer_names.id==names.index).select('name')

The select returns a Rows object, not just one row and not a field of
that row
so to get to the name field value you can do

db(db.customer_names.id==names.index).select('name').first().name

or
db(db.customer_names.id==names.index).select('name')[0].name

and then your variable will contain only the customer's name.

> and is displayed in the view html with:
>
> {{=current_customer_name))
>
> I need the results to be displayed in this form (which it does not):
> The Big Company
>
> It displays this (which won't work for
> me):                                                 NAME
>
> ------------------------------
>
> The Big Company
>
> I would appreciate any advice or pointers on where to look further.
> thanks in advance.
>
> James C.

Reply via email to