[web2py] How to avoid collisions in a multi user environment usung form grid

2018-01-10 Thread rafi farchi
Hi In a multi user environment , it is possible that 2 users are accessing the database using the wizard form grid or form smart grid . Suppose that the 2 users open in the edit window the same row . How a collision can be avoided ? That means i would like the a user will be blocked for

[web2py] Re: Parsing and Inserting data from a python dictionary into a database table using DAL

2018-01-10 Thread Anthony
If you can make the field names in the DAL model match exactly, you can simply do: db.mytable.insert(**db.mytable._filter_fields(record_dict)) If you can't change the field names in the database itself but are comfortable changing the names within your DAL models, you can use the "rname"

Re: [web2py] Is there a way to put icon or image picker in form?

2018-01-10 Thread Richard Vézina
sqlform.factory() if you have 2 tables like now and SQLFORM() if you recude this 2 table into 1. Richard On Tue, Jan 9, 2018 at 7:33 AM, Dragan Matic wrote: > I would like to have an icon or image picker in form where user could > choose from a set of predefined

[web2py] Re: iterselect() and doing other DB actions - Connection is busy with results for another command

2018-01-10 Thread Brian M
Thank you Anthony, that works! Only issue is that while using iterselect() you apparently can't do your own db.commit() or else you'll get "Function sequence error (0) (SQLFetch)" I suspect that it may be closing the result set that your'e trying to iterate over. :\ On Wednesday, January

[web2py] Parsing and Inserting data from a python dictionary into a database table using DAL

2018-01-10 Thread Rahul
Hi All, Massimo I am receiving a dictionary of records from a webservice like below (sample single record with just a few fields here) . Now I want to parse all the records and insert the data in my table (Currently SQLite and later it would be POSTGRE) . What is the best way to insert

[web2py] Re: iterselect() and doing other DB actions - Connection is busy with results for another command

2018-01-10 Thread Anthony
Have you tried enabling the Multiple Active Result Sets option? I think you can do so by adding the following to the connection string: DAL('mssql4://username:password@localhost/test?MARS_Connection=yes', ...) Note, it may need to be all caps -- MARS_CONNECTION. Anthony On Wednesday, January

[web2py] iterselect() and doing other DB actions - Connection is busy with results for another command

2018-01-10 Thread Brian M
I'm attempting to process through record sets from DAL queries that can sometimes return hundreds of thousands of records. To try to keep memory usage under control I wanted to use iterselect() instead of a plain DAL select(). However, the problem I'm running into is that as I process each

[web2py] Re: iterselect() and doing other DB actions - Connection is busy with results for another command

2018-01-10 Thread Anthony
On Wednesday, January 10, 2018 at 2:48:34 PM UTC-5, Brian M wrote: > > Thank you Anthony, that works! > > Only issue is that while using iterselect() you apparently can't do your > own db.commit() or else you'll get "Function sequence error (0) (SQLFetch)" > I suspect that it may be closing the

[web2py] Re: iterselect() and doing other DB actions - Connection is busy with results for another command

2018-01-10 Thread Brian M
Yes, I thought of a different DAL instance but for my situation it isn't really necessary since I can move when I do the commit() or just store that data elsewhere (the commit was really just to store a "I made it through this datetime" checkpoint record). I was more mentioning it for the next