Hello ty for the continued help. I did as you suggested and I saw the table
headers but none of the Data. I tried the function you suggested also.

Does that mean its a controller problem

Any ideas

*cheers



On Sat, Oct 16, 2010 at 12:14 AM, ron_m <[email protected]> wrote:

> 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 <[email protected]> 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