Thanks Anthony, args look good:
http://127.0.0.1:8000/ES1/default/comment_on_an_object?filter=5&id=1
but for 2nd variable,
objectComments = db.SuperObjectComment(request.get_vars.id)
this error appears:
<type 'exceptions.AttributeError'> 'str' object has no attribute
'created_on'
However, if I use below statement where everything else is the same:
objectComments = db(db.SuperObjectComment.id).select()
then there are no errors, but of course it selects the whole table without
filtering anything.
How can the filter be made to work?
FIRST CONTROLLER
dict(header='Comments', body=lambda row: A('Comments',_class="btn
btn-mini", _href=URL('comment_on_an_object', vars=dict(filter=row.objectID,
id=row.id)))),
SECOND CONTROLLER
objectComments = db.SuperObjectComment(request.get_vars.id)
HTML
{{extend 'layout.html'}}
<h1>View Comments</h1>
<h2>Comments for {{=A(commentsHeader.objectDisplayName)}}</h2>
<table>
{{for objectComment in objectComments:}}
<tr>
<td>{{=objectComment.created_on}}</td>
<td>{{=objectComment.created_by.first_name}} says </td>
<td>{{=MARKMIN(objectComment.superObjectComment)}}</td>
</tr>
{{pass}}
{{=form}}
</table>
thanks
Alex Glaros
--
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.