this works for me:

db.plano_aplicacao.codigo.represent= lambda codigo:
db.natureza_despesa[codigo].codigo + ' - ' +
db.natureza_despesa[codigo].especificacao ),

2010/1/13 Miguel Lopes <mig.e.lo...@gmail.com>

> I have the following tables: task, opportunity, and oppty_main
> With the following relations:
> * task.opportunity_id->opportunity.id
> * opportunity.oppty_main_id->oppty_main.id
>
> When updating a task I have a SELECT for the related opportunities:
>
> db.task.opportunity_id.requires=IS_NULL_OR(
>        IS_IN_DB(db(db.opportunity.id==db.task.opportunity_id),
> 'opportunity.id'))
>
> The problem is how to get the representation to show the name of the
> opportunity, which is at oppty_main.name!
> Something like (doesn't work):
> db.task.opportunity_id.requires=IS_NULL_OR(
>        IS_IN_DB(db(db.opportunity.id==db.task.opportunity_id),
> 'opportunity.id',
>                         '%(db.task.opportunity_id.oppty_main_id.name)s')
>
> Miguel
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com<web2py%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>
>
>


-- 
Atenciosamente

-- 
=========================
Alexandre Andrade
Hipercenter.com
--
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

Reply via email to