A couple of things

Put this in for the view html file temporarily

{{extend 'layout.html'}}
<hr />
{{=H2('Results')}}
{{=SQLTABLE(user_products,
   headers='fieldname:capitalize',
   truncate=100)
}}

and you should see a nicely formatted table of the results of the
query with the column names in the table header.

This will prove whether or not you are getting data in user_products.
If you see the expected results in the table then it is a view
problem. If the table is blank it is a controller problem.

Did you put a {{pass}} line at the point where the {{for row in
user_products:}} iteration loop should end? Indentation follows HTML
not Python rules in the {{}} code segments so pass is used to signal
the end of a block in this case "for".

http://web2py.com/book/default/chapter/05

Ron

On Oct 15, 11:29 pm, Andrew Evans <randra...@gmail.com> wrote:
> Hi ty for replying to my problem but I am a bit confused. I tried doing the
> query you suggested and tried doing it another way
>
> it seems my loop is never executed cause what appears there is a blank page.
>
> Not sure what I am doing wrong
>
> Those are the two I tried
>
> def indv_product():
>     this_page = request.args(0)
>
>     user_products = db((db.product.id == this_page) &
> (db.product_extended.product == this_page) & (db.user_extended.userinfo ==
> db.product.userinfo)).select()
>     return dict(user_products=user_products)
>
> def indv_product():
>     this_page = request.args(0)
>     user_products = db((db.product.id == this_page) & (db.product.id ==
> db.product_extended.product) & (db.product.userinfo ==
> db.user_extended.userinfo)).select()
>     return dict(user_products=user_products)
>
> But it seems the loop doesn't work any idea
>
> this is what I am using
>
> {{for row in user_products:}}
>
> and an example of how I am using row
> <p><img src="{{= URL('default','download', args=row.image)}}"
> alt="{{=row.product_name}}" width="400" height="425"
> />{{=row.description}}</p>
>
> The html doesn't even appear in the view source of my browser so I am doing
> something wrong
>
> *cheers

Reply via email to