As noted earlier, in the represent function, replace all of the
row.auth_user.* with row.*.
Anthony
On Tuesday, November 4, 2014 4:03:53 PM UTC-5, Alex Glaros wrote:
>
> HTML
> {{extend 'layout.html'}}
> <h1 style="margin:0px 0px 40px 0px">
> {{=A(commentsHeader.objectDisplayName)}}</h1>
> <table>
> {{for objectComment in objectComments.render():}} <!--- "render" causes
> error. Without "render" statement, no errors but primary key shows instead
> of name -->
> <tr>
> <td>{{=objectComment.created_on}}</td>
> <td>{{=objectComment.created_by}}</td>
> <!-- <td>{{=objectComment.created_by.first_name}} <br>
> {{=objectComment.created_by.last_name}}</td> This works, just to prove
> that row data arrives -->
> <td>{{=MARKMIN(objectComment.superObjectComment)}}</td>
> </tr>
> {{pass}}
> </table>
> <hr>
> {{=form}}
>
>
> CONTROLLER
> @auth.requires_login()
> def comment_on_an_object():
> db.SuperObjectComment.superObjectID.default = request.get_vars.filter
> db.SuperObjectComment.superObjectID.readable = False
> db.SuperObjectComment.superObjectID.writable = False
> commentsHeader=db.SuperObject(request.get_vars.filter)
> form = crud.create(db.SuperObjectComment)
> objectComments = db(db.SuperObjectComment.superObjectID ==
> request.get_vars.filter).select() ## ARGS PASSED - CREATES AN ITERABLE
> "SET"
> return locals()
>
>
> FUNCTION
> def person_represent(id, r):
> row = db.auth_user(id)
> return '%s %s %s' % (row.auth_user.first_name,
> row.auth_user.last_name, row.auth_user.currentPosition)
> db.SuperObjectComment.created_by.represent = person_represent
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
--
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/d/optout.