what more of the application do you need to see, which parts?

OS is Debian Lenny, Python 2.5 and the database is the default with web2py
SQLite I believe.

Will post my controller and views maybe that will help solve this

Controller

###Display.py###
###########################
# Display Indiviual Product
###########################

#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()
    #product_e=db(db.product_extended.product ==
this_page).select(db.product_extended.ALL)
    return dict(user_products=user_products)


This is my view index.html where I pass args to where I am calling the
function... I never posted the whole html file

{{=A(row.product_name,
_href=URL('display', 'indv_product', args=row.id))}}

and here is the is the indv_ptrdouct.html

{{for row in user_products:}}

and example of data

<div id="logo">
             <h1></h1>
            <p>{{=row.logo}}</p>
 </div>

{{pass}}

You can see the site @ www.em-ecommerce.com/Working/display/index to see
whats happening

*cheers


Andrew


On Sun, Oct 17, 2010 at 1:58 AM, ron_m <ron.mco...@gmail.com> wrote:

> After rereading the posts I realize you might be running the db calls
> in the view so the controller comment would be incorrect. Bottom line,
> there is no data to display from what you are telling me about the
> result of the last test. Is it possible to check the database and look
> at the data in the tables for a particular product id you are using
> for testing to be sure all the foreign keys are in place in the
> related tables. What environment are you running on? OS, Python
> version, database used? It is difficult to figure out the problem
> without seeing more of the application.
>
> Ron
>
> On Oct 16, 11:02 am, Andrew Evans <randra...@gmail.com> wrote:
> > 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 <ron.mco...@gmail.com> 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 <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