I have the following query: available_designs =
db(db.component.id==db.component_stock.fk_stock_component)(db.stock.fk_componentstock_authuser==auth.user).select()
which returns me a row: <Row {'component': {'component_description': 'x ',
'id': 1L, 'component_code': 'A253', 'path_to_source_file': 'x', 'name':
'y'}, 'stock': {'fk_stock_user': 1L, 'fk_stock_component': 1L,
'prints_available': 20L, 'id': 4L}}>
in view I want to print a table having the following columns: name,
component_description, prints_available from the row that the query returns
I don't know how to parse the row that the query returns. Could anyone help?
This is what i have written in view:
{{if available_designs:}}
<h3>{{=T('Designs available for print:')}}</h3>
{{i=0}}
<table>
<thead>
<th>#</th>
<th>{{=T('Component name')}}</th>
<th>{{=T('Description')}}</th>
<th>{{=T('Prints available)}}</th>
</thead>
<tbody>
{{for design in available_designs:}}
<tr><td>{{=i+1}}</td><td>{{=design.name}}</td><td>{{=design.component_description}}</td><td>{{=design.prints_available}}</td></tr>
{{pass}}
</tbody>
</table>
{{i=i+1}}
{{pass}}
--
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.