> I have only one more question: in which cases is right to define this in
the controller?
There is no rule, when the thing is global define in model, when is specific
to an action define it in the action.
represent works for crud,read ans crud.select forms, and some widgets also
uses it.
--
Thanks!
I'm very grateful for your help!
I have only one more question: in which cases is right to define this in the
controller?
You says:
you can define a represent in controller before creating the table or form.
db.table.field.represent = lambda .
that is for Table and Form Helpers?
A
you can put the attribution outside the loop, this will always be the same.
{{represent =* db.postulaciones.estado_postulacion.represent*}}
{{for postulacion in lista_postulaciones:}}
{{=postulacion.postulaciones.id}}
{{=postulacion.postulaciones.fecha_post
In that way it not work, but I tried this:
{{for postulacion in lista_postulaciones:}}
{{represent =*db.postulaciones.estado_postulacion.represent
*}}
{{=postulacion.postulaciones.id}}
{{=postulacion.postulaciones.fecha_
Sorry, I am wrong.. the correct should be
{{represent = postulacion.postulaciones.estado_postulacion.*represent*}}
{{=*represent(postulacion)*}}
I get this error:
AttributeError: 'str' object has no attribute 'represent'
does it work for you?
{{=postulacion.postulaciones.estado_postulacion.*represent()*}}
Thanks Bruno!
I'm doing something wrong:
*my controller*:
def index():
db.postulaciones.estado_postulacion.represent = lambda
r:db.estados_postulacion[r].nombre
lista_postulaciones = db(db.postulaciones.postulante ==
db.auth_user.id).select()
return dict( lista_postulaciones = lis
you can define a represent in controller before creating the table or form.
db.table.field.represent = lambda .
But, if you want to display the representation of a field without a table or
form, do:
{{=myrows.mycolumn.represent()}}
Hi!
I really can't get this done, please, any help is welcome.
Consider that I have this tables:
# models/db.py #
db.define_table('auth_user' ... )
db.define_table('estados_postulacion',
Field('nombre'),
Field('descripcion'),
format='[%(id)s] %(nombre)s')
db.define_table('postulacione
10 matches
Mail list logo