rows=db(db.shares.id>0).select(left=db.prices.on(db.prices.share_id==db.shares.id))
AND
{{for row in rows:}}
{{=row.shares.asx_code}}{{=row.prices.price_close}}
{{pass}}
OR BETTER
{{id=None}}
{{for row in rows:}}
{{if row.shares.id!=id:}}{{if id:}}{{pass}}
{{=row.shares.asx_code}}{{id
Hi Massimo - I should say thanks for the simple and interesting
framework you've made -thanks!
One share can have between zero and (practically) unlimited prices
associated to it, by i's ID.
Initially I want to list all prices associated to each share just to
get an idea of what I'm doing. Later
do you have only one price per share or multiple prices? If multiple
prices, do you want to list them all? Only the last one? what is the
criteria? Are you running on GAE?
On May 3, 7:12 am, ztd wrote:
> Another quick question. I've now stored prices.ALL into a variable
> 'prices' and passed to t
Another quick question. I've now stored prices.ALL into a variable
'prices' and passed to the view. I want to show each share as a line
with a subline for each price associated to that share. Here is the
code:
{{extend 'layout.html'}}
Share portfolio
{{for share in shares:}}
{{=LI(share.asx_code)
With the above two solutions I cleaned up the code and it now works.
I had changed this:
[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,db.shares.asx_code)]
to this
[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'shares.asx_code')]
and this:
{{for asx_code in shares:}}
{{=LI(shares.asx_code)}}
{{pass}}
to this:
{{for share i
On May 2, 11:02 am, ztd wrote:
> Hi,
>
> here is an error I receive in a simple stock tracking application I'm
> making to help me learn Web2Py:
>
> Traceback (most recent call last):
> File "gluon/restricted.py", line 178, in restricted
> File "C:\Users\Zac\Desktop\web2py\applications\shares/
6 matches
Mail list logo