[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: First Post so not a question

2016-09-07 Thread Dave S
On Wednesday, September 7, 2016 at 5:30:50 PM UTC-7, Peter wrote: > > Hi I'm Peter from Ireland, I've just joined this mailing list and I want > to say thank you, before > I start asking questions! > Welcome! > Also, many thanks to all the advisers and problem solvers on this forum > who

[web2py] Re: queue_task :: trouble with quoted json strings for pvars and args

2016-09-07 Thread Dave S
On Wednesday, September 7, 2016 at 5:30:49 PM UTC-7, Erwn Ltmann wrote: > > Hi, > > I'm used to create a new task for example: > > scheduler.queue_task( > "a_task", > pvars = dict(csid=row.id, csname=row.name, action=row.action), > ... > ) > > In the past (version 2.10.1)

[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

[web2py] Re: How to code efficiently for multiple database engines with Exceptions

2016-09-07 Thread Massimo Di Pierro
I strongly recommend you do not use pg8000. We always run into issues with it. pip install psycopg2 Massimo On Wednesday, 7 September 2016 17:05:28 UTC-5, Joe Barnhart wrote: > > Sweet! That's exactly what I'm looking for. I was missing the > db._adapter connection to pg8000 or whatever dri

[web2py] Re: Update javascript object by ajax

2016-09-07 Thread Massimo Di Pierro
I get the problem. That is not valid JSON. You should not generate JSON. response.json(locations) will generate the JSON. def get_locations(): events = db(db.events.id>0).select() locations = map(lambda event: { 'title': event.title, 'link': URL('defa

[web2py] Set the Atom Editor to auto complete web2py

2016-09-07 Thread Rafael Oliveira
Good Morning. I wanted to set the Atom Editor to auto complete web2py, already tried in some tutorials and I can not. I use Windows 10. I managed to make Python auto complete. Thank you in advance. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/w

[web2py] First Post so not a question

2016-09-07 Thread Peter
Hi I'm Peter from Ireland, I've just joined this mailing list and I want to say thank you, before I start asking questions! So a huge thank to Massimo for web2py and Guido for Python! As a wannabe programmer I have spent considerable time over the last two or three years doing online Python

[web2py] queue_task :: trouble with quoted json strings for pvars and args

2016-09-07 Thread Erwn Ltmann
Hi, I'm used to create a new task for example: scheduler.queue_task( "a_task", pvars = dict(csid=row.id, csname=row.name, action=row.action), ... ) In the past (version 2.10.1), everything was fine. Within the current version (2.14.6) I have some trouble. See this code for exa

[web2py] Preserving objects sort order between controller and view

2016-09-07 Thread Peter
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 result because when I output the rows to the log file the dates appear in the required o

[web2py] Re: How to code efficiently for multiple database engines with Exceptions

2016-09-07 Thread Joe Barnhart
Sweet! That's exactly what I'm looking for. I was missing the db._adapter connection to pg8000 or whatever driver is used at the moment. This should totally fix my wagon. -- Joe On Wednesday, September 7, 2016 at 12:47:48 PM UTC-7, Anthony wrote: > > According to the Python DB API specifica

[web2py] Is it risky to smuggle variables into a Row object?

2016-09-07 Thread Antonio Salazar
I have a function that returns several rows object, and each row needs a small list with valid workflow transitions. I feel the workflow transitions belong in a separate variable variable, but I tried adding it to each row, and it works and doesn't appear to interfere with database operations.

[web2py] Re: how to change color and case of form buttons

2016-09-07 Thread Donald McClymont
Downloading your own bootstrap theme is also an option - this can obviously change a lot more than just the button styles and there is also a choice of formstyles eg web2py, bootstrap, bootstrap3 which you could also tweak as more comprehensive solutions than just changing the button style --

[web2py] Re: how to change color and case of form buttons

2016-09-07 Thread Dave S
On Wednesday, September 7, 2016 at 9:33:27 AM UTC-7, Alex Glaros wrote: > > okay, I see, seems that web2py bootstrap.css.min is different than direct > download from bootstrap. Has changes like: > > btn { > >1. border: none; >2. font-size: 11px; >3. line-height: 22px; >4. font-w

[web2py] Find rows wich are from x meters from a point with st_distance

2016-09-07 Thread Gael Princivalle
Hello. I'm trying to select all rows within X meters from a lat/long point. These was already discussed here: https://groups.google.com/forum/#!searchin/web2py/st_distance|sort:relevance/web2py/Js8amC9SMoY/Ds-X3ysFAgAJ Anyway I don't reach to find the way to have the good result. Here is the db

[web2py] Re: How to code efficiently for multiple database engines with Exceptions

2016-09-07 Thread Anthony
And more generally, you could always do something like: try: db.mytable.insert(**fields) except Exception as e: if type(e).__name__ == 'OperationalError': pass else: raise e Anthony On Wednesday, September 7, 2016 at 3:47:48 PM UTC-4, Anthony wrote: > > According to t

[web2py] Re: How to code efficiently for multiple database engines with Exceptions

2016-09-07 Thread Anthony
According to the Python DB API specification, there should be a common set of exceptions , and they should be exposed as attributes on the connection object . Therefore, you should

Re: [web2py] Re: web3py status

2016-09-07 Thread Paolo Valleri
Current master branch passes almost all unittests on python 3.5. If anyone is interested in helping with the final steps, a checklist is here https://github.com/web2py/web2py/issues/1353#issue-159010482 On Tuesday, September 6, 2016 at 5:43:55 AM UTC+2, jjs0sbw wrote: > > I agree that a better te

[web2py] How to code efficiently for multiple database engines with Exceptions

2016-09-07 Thread Joe Barnhart
So my website runs under PostgresSQL today but will likely be switched to MySql at some point in the future. My problem isn't with the DAL -- it performs fine for what it does, insulating me very well from the nuances of the SQL syntax for each engine. No, my problem comes from Exceptions. Ea

[web2py] Re: how to change color and case of form buttons

2016-09-07 Thread Alex Glaros
okay, I see, seems that web2py bootstrap.css.min is different than direct download from bootstrap. Has changes like: btn { 1. border: none; 2. font-size: 11px; 3. line-height: 22px; 4. font-weight: 500; 5. text-transform: uppercase; } Tried replacing the whole css file. Button

[web2py] Re: SQLFORM.grid problems with Oracle database tables

2016-09-07 Thread Nico de Groot
Ok, I missed that. As you describe it, it looks like a bug in the DAL Oracle driver. Maybe you can document a simple example reproducing it and create an issue, leaving out the grid references, it's just the query going wrong, right? Issue tracker is located at https://github.com/web2py/pydal

[web2py] Re: Limit search fields in SQLFORM grid, in search panel

2016-09-07 Thread Dave S
On Tuesday, September 6, 2016 at 7:43:17 AM UTC-7, Piklu Dey wrote: > > Hi, > > I have a query please refer to the figure below: > > [image: Inline image 1] > There's a problem with your image ... did you attach it properly? > > This is SQLFORM.grid table. In the search panel, all the fields

[web2py] Re: redirection using ajax with javascript variables passed in the url.

2016-09-07 Thread Dave S
On Tuesday, September 6, 2016 at 7:43:17 AM UTC-7, VAISHALI SHARMA wrote: > > Please reply.I am stuck at this for quite a long now :( > I think you were entering your post as Massimo was entering his ... did his suggestion help? If you aren't using Chrome, your browser probably has an equivale

[web2py] Re: Cannot Create Table Named "Items" - Already Exists

2016-09-07 Thread Dave S
On Tuesday, September 6, 2016 at 7:37:54 AM UTC-7, Massimo Di Pierro wrote: > > yes. Items is a reserved keyword for this reason. > The trick is knowing which keywords are reserved, before trying to use them and getting an error message :-) /dps > > On Friday, 2 September 2016 05:02:52 UTC

[web2py] Re: Smartgrid search: How do I search on integers and linked tables?

2016-09-07 Thread Dave S
On Tuesday, September 6, 2016 at 7:37:00 AM UTC-7, Massimo Di Pierro wrote: > > You can customize smartgrid and make your own search function. By default > you cannot. > Is this an example of a reply that is too terse? I think you mean "the defaults for smartgrid do not allow searching by int