Hi,
As I understand, when crud.update(...) creates a form it pulls the
values of a given record into the form as a string.  If the field is a
reference to another table, then this shows up as a number.  I would
like to instead show the name of the record instead of the id. I have
a represent function set in the data model, but that is only used on
crud.select().

So, my question is how can I get the crud.update(...) form to render
the record values with according to the represent function specified
by the represent function of the field.  Code below:

#model
db.define_table("food",
    Field("desc", "string",)
)

db.define_table("ate",
    Field("food_id", db.food,
        represent=lambda x: db(db.food.id==x).select().first().desc
    )
)

#controller
form=crud.update(db.ate,ate_id)

Thanks,
Avik

-- 
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