On Feb 27, 5:41 pm, Massimo Di Pierro <[email protected]>
wrote:
> Here is a possible solution (typos aside):
>
> def index():
> return
> dict(rows=db(db.ratings_view).select(db.ratings_view.affirm_pkey,distinct=T
> rue))
>
> def callback():
> return
> SQLTABLE(db(db.ratings_view.affirm_pkey==request.args(0)).select())
>
> and in view/default/index.html()
>
> {{extend 'layout.html'}}
> <div id="top">
> {{for row in rows:}}
> <button onclick="ajax('{{=URL('callback',args=rowaffirm_pkey)}}',
> [],'bottom');">{{=row.affirm_pkey}}</button>
> </div>
> <div id="bottom">
> </div>
>
thx for the quick reply
is the '>' necessary before {{=row.affirm_pkey}} ??
if it is removed, I get
"missing pass in view"
if it is there, and I typed it in right
it is simply a very long error in parse container with no msg
-Brian
> On Feb 27, 6:53 pm, darkblue_b <[email protected]> wrote:
>
> > Hi- maybe this is really easy and I havent found it yet..
> > I now have a table defined in db.py, like so
>
> > db.define_table('ratings_view',
> > Field('flat_key', type='integer'),
> > Field('rating_value', type='double'),
> > Field('category', type='text'),
> > Field('credit', type='text'),
> > Field('subcredit', type='text'),
> > Field('credit_weighting', type='integer'),
> > Field('category_weighting', type='integer'),
> > Field('subcredit_weighting', type='integer'),
> > Field('affirm_pkey', type='integer'),
> > Field('date_executed', type='date'),
> > Field('who_string', type='text'),
> > primarykey=['flat_key'],
> > migrate=migrate) ##<- I dont know what this does yet --
>
> > I want an HTML page that has two parts, a pop-up menu with a list of
> > DISTINCT(affirm_pkey) at the top, and a table display below. The user
> > chooses an affirm_pkey, and the display table is filled with results.
> > In my case, there are always 253 rows per affirm_key. (this table
> > definition is actually a VIEW defined in postgres.. it seems to work
> > fine)
>
> > thanks in advance -Brian