Hi,
I want to display item and use the represent() method to display reference
fields.
def home():
all_items = db(db.t_items).select()
owner_rep = db.t_stores.created_by
store_rep = db.t_stores.f_store_name
category_rep = db.t_categories.f_category_name
return dict(all_items = all_items, owner_rep = owner_rep, store_rep =
store_rep, category_rep = category_rep)
#On the view page :
{{for item in all_items:}}
{{=owner_rep.represent(item.created_by)}}
{{=category_rep.represent(item.f_item_category)}}
{{=store_rep.represent(item.f_item_store)}}
{{pass}}
While it works for the {{=owner_rep....... line, for any of the other lines
I try to do the same (those under it) I get the error:
TypeError: 'NoneType' object is not callable.
Thanks.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.