[web2py] Re: Preserving objects sort order between controller and view

2016-09-08 Thread Peter
Some times you just have to laugh! I have totally screwed things up (I have a backup but was hoping not to use it) I dropped the invoice table and started getting this... table invoice already exists on investigation the error, I discovered I had not included a db.commit() after the drop Fou

[web2py] Re: Preserving objects sort order between controller and view

2016-09-07 Thread Dave S
On Wednesday, September 7, 2016 at 10:00:05 PM UTC-7, Peter wrote: > > > Thanks for the response Dave, > > I haven't got the hang of this editor yet so I hope this doesn't appear as > a total mess... > > My view code... > > {{ line=0 }} > {{=inv_lines }} > {

[web2py] Re: Preserving objects sort order between controller and view

2016-09-07 Thread Peter
Thanks for the response Dave, I haven't got the hang of this editor yet so I hope this doesn't appear as a total mess... My view code... {{ line=0 }} {{=inv_lines }} {{ for item in inv_lines: }} {{ line+=1}} {{ =line

[web2py] Re: Preserving objects sort order between controller and view

2016-09-07 Thread Dave S
On Wednesday, September 7, 2016 at 6:52:01 PM UTC-7, Dave S wrote: > > [...] > Python dictionaries do not guarantee any particular ordering. Python lists > do, and the DAL Rows object is a special subclass of a list, > and your inv_list should have the ordering that your query gave it, and >

[web2py] Re: Preserving objects sort order between controller and view

2016-09-07 Thread Dave S
See below: On Wednesday, September 7, 2016 at 5:30:49 PM UTC-7, Peter wrote: > > My first question and I hope it's not a dumb one! > > My controller retrieves a number of rows from a table and I use *orderby= > 'start_time' *to sort the list into date order. > I can see this produces the desired