Re: [web2py] Re: Ongoing issue with 'Lost connection to MySQL server during query'

2015-03-17 Thread Paolo Valleri
Ian, as mentioned before, with the last trunk a reconnect can be done with
the following:
- db._adapter.close()
- db._adapter.reconnect()
Without the last trunk, try the following:
try:
 db._adapter.close()
except:
 db._adapter.connection = None
db._adapter.reconnect()

but my suggestion is to use the last trunk




 Paolo

2015-03-17 11:02 GMT+01:00 Ian Ryder i.ry...@appichar.com.au:

 The issue sits with the parent method - it calls a method which takes 
 300 seconds, then whatever action is taken with the database in the parent
 method on return blows up.

 I think I've cracked it though - and to get there I had to drop the web2py
 scheduler and write my own so I knew what was going on!

 Anyway, for anyone else in the same situation (unless web2py handles this
 natively down the track), I basically have to reconnect completely, ie:

- db = DAL('mysql://XX@mysql.server/xxx',
fake_migrate=False, pool_size=10)
- define all the tables again
- reload any records I had open in the calling method

 I've written the relevant methods to make it all fairly neat...it's not
 the end of the universe and may be the only way but seems clunky...given
 I've been living with this for 2 or 3 months I'm just happy I have an
 answer that seems properly robust ;)

 On Tuesday, March 17, 2015 at 1:07:06 AM UTC+11, Paolo Valleri wrote:

 your query takes to much time to be executed and the query goes into
 timeout.
 From the log I see that you are running a bulk_insert, you can split it
 into more operations, placing a db.commit between them.
 Mind that in this case the bulk_insert will be executed into few
 transactions.

 Otherwise, you can run a custom bulk_insert based on an executesql
 containing all the inserts.
 let us know more information about the query.

  Paolo

 2015-03-15 2:01 GMT+01:00 Ian Ryder i.r...@appichar.com.au:

 Thanks Paolo - sadly same result :( I'm not using pyDAL, just the usual
 Web2py DAL

 ##
  305
 ##
 Traceback (most recent call last):
   File /home/ianryder/yarpr/web2py/gluon/restricted.py, line 224, in
 restricted
 exec ccode in environment
   File applications/yarpr/models/my_scheduler.py, line 554, in
 module
 PenguinDoer(db_app)
   File applications/yarpr/models/my_scheduler.py, line 468, in
 __init__
 debug_log(sys._getframe().f_code.co_name, None, start=method_start,
 error_details=ee, severity='Fail')
   File applications/yarpr/models/do_debugging.py, line 197, in
 debug_log
 debug_flush()
   File applications/yarpr/models/do_debugging.py, line 201, in
 debug_flush
 db_usage.debug_data.bulk_insert(DebugHandler.debug_records)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 9425, in
 bulk_insert
 ret = self._db._adapter.bulk_insert(self, items)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1376, in
 bulk_insert
 return [self.insert(table, item) for item in items]
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1361, in insert
 raise e
 OperationalError: (2006, 'MySQL server has gone away')

 Here's the code:
 self.dbase.commit()
 self.dbase._adapter.close(action=None)
 try:
 # now the long running task - in the test it's a sleep for
 305 seconds.
 run_method(
 *loads(this_task.args, object_hook=self._decode_dict),
 **loads(this_task.vars, object_hook=self._decode_dict))
 #, *passed_vars)
 except Exception as ee:
 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 FAILED,
 'Failed: ' + str(ee)
 )
 this_doer.update_record()
 debug_log(sys._getframe().f_code.co_name, None,
 start=method_start, error_details=ee, severity='Fail')
 raise Exception('Failure during method execution: ' +
 str(ee))

 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 COMPLETED,
 'Normal exit'
 )




 On Sunday, March 15, 2015 at 12:04:04 AM UTC+11, Paolo Valleri wrote:

 Hi,
 first of all use the latest pydal, it contains a fix when trying to
 close 'broken connection'.
 Afterwards, for a proper reconnect in your application you should do:
 - db._adapter.close()
 - db._adapter.reconnect()

 If you are looking for an 'auto-reconnect', namely it will re-execute
 all queries in the broken transaction, I've been working on it, have a look
 at https://github.com/ilvalle/pydal/tree/auto-reconnect
 In this case it will re-execute all commands in the last transaction
 (but if you do a db.commit() before the operation, then it is fine).
 a discussion about this new feature is here: https://groups.google.co
 m/d/topic/web2py-developers/e161iZZmp0Y/discussion
 Finally, I've never tried it with mysql, but it should work since
 an 

Re: [web2py] for Testers

2015-03-17 Thread Richard Vézina
Don't start with double click over web2py.py...

Richard

On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in
 module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com:
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the Google Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: internal error: [Errno 1] Operation not permitted when attempting Pack All

2015-03-17 Thread Marco Mansilla
El Tue, 17 Mar 2015 19:38:07 -0700 (PDT)
LoveWeb2py atayloru...@gmail.com escribió:

 Check your file permissions. Are you using windows or linux? 
 
 On Tuesday, March 17, 2015 at 8:17:46 PM UTC-4, Tom Campbell wrote:
 
  Attempting to do a Manage  Pack All on a project but I get this
  message:
 
  messageinternal error: [Errno 1] Operation not permitted: 
 
  I am attempting to save to the Dropbox directory in which web2py
  lives. What should to do to get it to pack correctly?
 
 

Actually you should check your folder permissions, since that seems to
be complaining about.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Wrong installed apps list in admin

2015-03-17 Thread Roberto Perdomo
On a fresh download using web2py_osx.zip after uncompress:

ls -las Resources/applications/

total 40
 0 drwxrwxr-x@ 17 roberto  staff   578 Feb 14 05:54 .
 0 drwxrwxr-x@ 29 roberto  staff   986 Feb 15 23:04 ..
 8 -rw-rw-r--@  1 roberto  staff   214 Feb 14 05:34 ABOUT
16 -rw-rw-r--@  1 roberto  staff  6826 Feb 14 05:34 LICENSE
 8 -rw-rw-r--@  1 roberto  staff 1 Feb 15 23:04 __init__.py
 0 drwxrwxr-x@ 14 roberto  staff   476 Mar 20  2014 admin
 0 drwxrwxr-x@ 13 roberto  staff   442 Feb 14 05:34 controllers
 0 drwxrwxr-x@  4 roberto  staff   136 Feb 14 05:34 cron
 0 drwxrwxr-x@ 12 roberto  staff   408 Feb 14 06:12 examples
 0 drwxrwxr-x@ 29 roberto  staff   986 Feb 14 05:34 languages
 0 drwxrwxr-x@ 10 roberto  staff   340 Feb 14 05:34 models
 0 drwxrwxr-x@  3 roberto  staff   102 Feb 14 05:34 modules
 0 drwxrwxr-x@  3 roberto  staff   102 Feb 14 05:34 private
 8 -rw-rw-r--@  1 roberto  staff   183 Feb 14 05:34 settings.cfg
 0 drwxrwxr-x@  9 roberto  staff   306 Feb 14 05:34 static
 0 drwxrwxr-x@ 16 roberto  staff   544 Feb 14 05:34 views
 0 drwxrwxr-x@ 13 roberto  staff   442 Feb 14 05:54 welcome

I always use compression utility from Apple or The Unarchiver to
uncompress, and this software creates automatically a new folder named
web2py (web2py 2, ...,  web2py n) with the web2py.app within it

2015-03-17 13:52 GMT-04:30 Massimo Di Pierro massimo.dipie...@gmail.com:
 Can you try again? Get a fresh download and check that the files are not
 there. They should not be there.


 On Tuesday, 17 March 2015 12:52:06 UTC-5, Gray Kanarek wrote:

 I also saw all of those when I installed a fresh mac web2py a couple weeks
 ago... but when I installed via pythonanywhere, they were not included.

 On Tuesday, March 17, 2015 at 10:35:55 AM UTC-4, Massimo Di Pierro wrote:

 ca you get a directory listing under web2py/applications? I think you
 have accidentally copied something there. I do not see those folders in
 web2py.

 On Monday, 16 March 2015 21:01:49 UTC-5, Roberto Perdomo wrote:

 Hi Everybody,

 I recently downloaded the latest version of Web2py for Mac and I see a
 lot of wrong directories in the list of applications  available
 (admin/default/site). Anyone know the reason of that?

 Web2py Version: 2.9.12-stable+timestamp.2015.02.15.23.04.25
 (Ejecutando en Rocket 1.2.6, Python 2.7.3)

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Select categories that are in use

2015-03-17 Thread Johann Spies
Good to know.  Thanks.

Johann

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Executesql SQLFORM.grid

2015-03-17 Thread Johann Spies
What I do is to create a view or create table as (select...) and then
define a table in the controller to correspond to the view or table and
then use the grid to show the data in the view/table.  If your query is one
that will be repeated a lot of times you can make use of materialized
views  in PostgreSQL 9.4.

Regards
Johann

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Executesql SQLFORM.grid

2015-03-17 Thread Manuele Pesenti
Il 17/03/15 07:52, Johann Spies ha scritto:
 What I do is to create a view or create table as (select...) and
 then define a table in the controller to correspond to the view or
 table and then use the grid to show the data in the view/table.  If
 your query is one that will be repeated a lot of times you can make
 use of materialized views  in PostgreSQL 9.4.

 Regards
 Johann
Sometimes I adopted this solution too and it works very well.
Just remember to use migrate parameter set to False defining the table
that describe your view.

M.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Richard Vézina
Ok, my bads...

:)

Looks like a good version!!

Richard

On Tue, Mar 17, 2015 at 3:09 PM, Richard Vézina ml.richard.vez...@gmail.com
 wrote:

 My app work well, not seems to have backward issue... I notice an issue
 with permission enforcement though, I will look at my code first... And get
 back here if I it is not my mistake...

 Richard

 On Tue, Mar 17, 2015 at 2:49 PM, Richard Vézina 
 ml.richard.vez...@gmail.com wrote:

 Working now...

 One thing was I forgot another instance of web2py working... Which seems
 to make it slow before the ui launcher start... But once started the launch
 refuse to start another instance since it was going to use the same port of
 the other... Anyway it works...

 Richard

 On Tue, Mar 17, 2015 at 2:39 PM, Richard Vézina 
 ml.richard.vez...@gmail.com wrote:

 Maybe, though it works with web2py 2.9.5

 I try with command line...

 RIchard

 On Tue, Mar 17, 2015 at 2:25 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 That may be a setting of your machine that if you click on a .py file
 it opens it for edit instead or running it. Actually have the same default
 setting.


 On Tuesday, 17 March 2015 13:15:24 UTC-5, Richard wrote:

 The ui web2py launch don't show up!!

 I download form web2py.com/download : for tester is it the version
 you want us to test?

 Richard

 On Tue, Mar 17, 2015 at 1:55 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 Richard. What do you mean?


 On Tuesday, 17 March 2015 09:59:02 UTC-5, Richard wrote:

 Don't start with double click over web2py.py...

 Richard

 On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
 angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29,
 in module
 You can also download a complete copy from
 http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have
 not installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro 
 massimo.dipie...@gmail.com:
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the
 Google Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it,
 send an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.






-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: action when leaving a page

2015-03-17 Thread Leonel Câmara
You should not be clearing the session anywhere except for logouts. The 
multiple characters problem would be easy to solve if you sent the 
character ID in each request and used a corresponding key to store in the 
session. For instance your URL to play could be mygame.com/play/character_id
  
You could also just try and send the character id with every request and 
reading and writing from the database every request, it may be fast enough, 
databases are really smart about caching nowadays so you may be prematurely 
optimizing something that doesn't need it.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread Niphlod
an ON INSERT trigger usually happens at the moment you're about to insert a 
new record. This will make inserting the same row over and over just an 
update to the row, instead of an insertion of the new one.
With that in place, you can skip your own validation and just insert the 
whole file, the database will take care of updating an existing or 
inserting a new one.
Now, every serious database has it, but as far as I recall in Mysql is not 
possible. However, mysql has UPSERT . You can read about it on the 
manuals, and evaluate all pros and cons.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread Niphlod
I'm saying it often lacks standard features you'd expect from a relational 
backend. I'm more biased towards postgresql.

On Tuesday, March 17, 2015 at 10:02:37 PM UTC+1, LoveWeb2py wrote:

 Please forgive me if I'm interpreting your message incorrectly, but are 
 you saying MySQL is not a serious database? What DB do you recommend? 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread LoveWeb2py
Please forgive me if I'm interpreting your message incorrectly, but are you 
saying MySQL is not a serious database? What DB do you recommend? 

On Tuesday, March 17, 2015 at 3:58:29 PM UTC-4, Niphlod wrote:

 an ON INSERT trigger usually happens at the moment you're about to insert 
 a new record. This will make inserting the same row over and over just an 
 update to the row, instead of an insertion of the new one.
 With that in place, you can skip your own validation and just insert the 
 whole file, the database will take care of updating an existing or 
 inserting a new one.
 Now, every serious database has it, but as far as I recall in Mysql is not 
 possible. However, mysql has UPSERT . You can read about it on the 
 manuals, and evaluate all pros and cons.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: action when leaving a page

2015-03-17 Thread Gray Kanarek
Ah, sure.

The game is a text adventure that I wrote as a command-line python game 
(actually, originally it ran via a bot in irc), which is why I wanted to 
use a python web framework to design the web interface. The gamestate is a 
jsonpickle of the game engine object heirarchy, and the character is a 
dictionary (basically grabbed from and saved to the characters sqlite db). 
I have a separate page for character creation, so I store the character 
dict in session to transfer from the chargen page to the play page, and 
then (when the game is initialized/loaded), I also store the gamestate 
jsonpickle in session so that the game engine modules and command parser 
can access them.

At the moment, I clear the gamestate and character data session variables 
in the controllers of pages besides play(), because when I didn't (during 
my testing), if I created a character, started the game, and then created a 
new character, the new character acquired the old character's gamestate, 
which caused several errors. However, when I do that, if one of those other 
pages is opened in a new tab while the play page is still there, it clears 
the character data and gamestate, which causes the still-active game to 
crash.

What I want is for the gamestate and character dict to be cleared when the 
page is closed/navigated away from... though I can still foresee an error 
if you try to play on two different pages at the same time in the same 
session. I'm not really sure how to fix this, honestly.

On Tuesday, March 17, 2015 at 11:22:21 AM UTC-4, Leonel Câmara wrote:

 Well if the game is in javascript and running on people's browser they 
 could theoretically do all the cheats they want anyway.

 You could use window.onbeforeunload to delete the data when the user 
 leaves a page, but that wouldn't help if the user opens another page in a 
 new tab that deletes your session.

 I think you need to give us more information on what exactly is going on 
 and what you're trying to achieve.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Richard Vézina
Working now...

One thing was I forgot another instance of web2py working... Which seems to
make it slow before the ui launcher start... But once started the launch
refuse to start another instance since it was going to use the same port of
the other... Anyway it works...

Richard

On Tue, Mar 17, 2015 at 2:39 PM, Richard Vézina ml.richard.vez...@gmail.com
 wrote:

 Maybe, though it works with web2py 2.9.5

 I try with command line...

 RIchard

 On Tue, Mar 17, 2015 at 2:25 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 That may be a setting of your machine that if you click on a .py file it
 opens it for edit instead or running it. Actually have the same default
 setting.


 On Tuesday, 17 March 2015 13:15:24 UTC-5, Richard wrote:

 The ui web2py launch don't show up!!

 I download form web2py.com/download : for tester is it the version you
 want us to test?

 Richard

 On Tue, Mar 17, 2015 at 1:55 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 Richard. What do you mean?


 On Tuesday, 17 March 2015 09:59:02 UTC-5, Richard wrote:

 Don't start with double click over web2py.py...

 Richard

 On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
 angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29,
 in module
 You can also download a complete copy from http://www.web2py.com
 .
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro 
 massimo.dipie...@gmail.com:
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the Google
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it,
 send an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLForms DAL error

2015-03-17 Thread Dave S


On Tuesday, March 17, 2015 at 10:00:05 AM UTC-7, pumplerod wrote:

 My Mistake.  I did indeed find the db=DAL(...) elsewhere located.  Thank 
 you so much for letting me know what to look for.


Glad you were able to get it sorted.

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Wrong installed apps list in admin

2015-03-17 Thread Gray Kanarek
I also saw all of those when I installed a fresh mac web2py a couple weeks 
ago... but when I installed via pythonanywhere, they were not included.

On Tuesday, March 17, 2015 at 10:35:55 AM UTC-4, Massimo Di Pierro wrote:

 ca you get a directory listing under web2py/applications? I think you have 
 accidentally copied something there. I do not see those folders in web2py.

 On Monday, 16 March 2015 21:01:49 UTC-5, Roberto Perdomo wrote:

 Hi Everybody, 

 I recently downloaded the latest version of Web2py for Mac and I see a 
 lot of wrong directories in the list of applications  available 
 (admin/default/site). Anyone know the reason of that? 

 Web2py Version: 2.9.12-stable+timestamp.2015.02.15.23.04.25 
 (Ejecutando en Rocket 1.2.6, Python 2.7.3) 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Massimo Di Pierro
Please try one more time. Thanks!

On Tuesday, 17 March 2015 09:56:03 UTC-5, AngeloC wrote:

 Hi Massimo, 

 I just downloaded the src zip and this is the error output: 

 Traceback (most recent call last): 
   File web2py.py, line 18, in module 
 import gluon.widget 
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in 
 module 
 You can also download a complete copy from http://www.web2py.com.; 
 RuntimeError: web2py depends on pydal, which apparently you have not 
 installed. 
 Probably you cloned the repository using git without '--recursive' 
 To fix this, please run (from inside your web2py folder): 

  git submodule update --init --recursive 

 You can also download a complete copy from http://www.web2py.com. 


 Unfortunately is not a git repository, so it cannot be done! 

 Ciao! 

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com: 

  Can you please help us test the for testers version of web2py? 
  
  -- 
  Resources: 
  - http://web2py.com 
  - http://web2py.com/book (Documentation) 
  - http://github.com/web2py/web2py (Source code) 
  - https://code.google.com/p/web2py/issues/list (Report Issues) 
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  web2py-users group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to web2py+unsubscr...@googlegroups.com. 
  For more options, visit https://groups.google.com/d/optout. 



 -- 
 Profile: http://it.linkedin.com/in/compagnucciangelo 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Wrong installed apps list in admin

2015-03-17 Thread Massimo Di Pierro
Can you try again? Get a fresh download and check that the files are not 
there. They should not be there.

On Tuesday, 17 March 2015 12:52:06 UTC-5, Gray Kanarek wrote:

 I also saw all of those when I installed a fresh mac web2py a couple weeks 
 ago... but when I installed via pythonanywhere, they were not included.

 On Tuesday, March 17, 2015 at 10:35:55 AM UTC-4, Massimo Di Pierro wrote:

 ca you get a directory listing under web2py/applications? I think you 
 have accidentally copied something there. I do not see those folders in 
 web2py.

 On Monday, 16 March 2015 21:01:49 UTC-5, Roberto Perdomo wrote:

 Hi Everybody, 

 I recently downloaded the latest version of Web2py for Mac and I see a 
 lot of wrong directories in the list of applications  available 
 (admin/default/site). Anyone know the reason of that? 

 Web2py Version: 2.9.12-stable+timestamp.2015.02.15.23.04.25 
 (Ejecutando en Rocket 1.2.6, Python 2.7.3) 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-03-17 Thread Kiran Subbaraman

This seems to be the site: http://10biosystems.com

Also, *Sebastian*, it would be helpful if you can refer to web2py on 
your site too; especially since you mention the open source stack that 
is powering this site (http://10biosystems.com/init/default/mobile)



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 17-03-2015 11:09 PM, Dave S wrote:



On Monday, March 16, 2015 at 6:57:54 PM UTC-7, DJ wrote:

Hi Massimo,

10Biosystems.com has been doing web2Py consulting  bioinformatics
product development for lifesciences  healthcare for a few years
now. Kindly add us!

Thanks,
Sebastian




Is there a website or contact information?  Which region are you 
located in?


/dps

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
mailto:web2py+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Massimo Di Pierro
Richard. What do you mean?

On Tuesday, 17 March 2015 09:59:02 UTC-5, Richard wrote:

 Don't start with double click over web2py.py...

 Richard

 On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
 angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in 
 module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not 
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com
 :
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the Google 
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it, send 
 an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Richard Vézina
The ui web2py launch don't show up!!

I download form web2py.com/download : for tester is it the version you want
us to test?

Richard

On Tue, Mar 17, 2015 at 1:55 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Richard. What do you mean?


 On Tuesday, 17 March 2015 09:59:02 UTC-5, Richard wrote:

 Don't start with double click over web2py.py...

 Richard

 On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
 angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in
 module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com
 :
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the Google
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it, send
 an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: for Testers

2015-03-17 Thread Kiran Subbaraman
Downloaded this version:
I installed my current app, to test this version. I see the following error
Version
web2py™ Version 2.9.12-stable+timestamp.2015.03.17.18.03.34
Python Python 2.7.9: C:\Users\subbaraman\Downloads\web2py_win_001\web2py
\web2py.exe (prefix: D:\programs\open\python27)
Traceback

Traceback (most recent call last):
  File 
C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\restricted.py, 
line 226, in restricted
exec ccode in environment
  File 
C:/Users/subbaraman/Downloads/web2py_win_001/web2py/applications/my_app/controllers/default.py
, line 1107, in module
  File 
C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\globals.py, 
line 393, in lambda
self._caller = lambda f: f()
  File C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\tools.py, 
line 3456, in f
return action(*a, **b)
  File 
C:/Users/subbaraman/Downloads/web2py_win_001/web2py/applications/my_app/controllers/default.py
, line 304, in index
orderby=_construct_orderby(), limitby=limitby, **cache_settings)
  File 
C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\packages\dal\pydal\objects.py
, line 2085, in select
return adapter.select(self.query,fields,attributes)
  File 
C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\packages\dal\pydal\adapters\base.py
, line 1228, in select
time_expire)
  File C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\cache.py, 
line 413, in __call__
item = self.storage.get(key)
  File C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\cache.py, 
line 369, in get
return self[key]
  File C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\cache.py, 
line 341, in __getitem__
timestamp, value = pickle.load(recfile.open(key, 'rb', path=self.folder
))
  File 
C:\Users\subbaraman\Downloads\web2py_win_001\web2py\gluon\custom_import.py
, line 105, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named objects






On Tuesday, March 17, 2015 at 8:10:17 PM UTC+5:30, Massimo Di Pierro wrote:

 Can you please help us test the for testers version of web2py?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread LoveWeb2py
Niphlod,

pkeys and code a trigger (ON INSERT). Could you provide an example of this? 
Just want to make sure I understand it properly.


On Monday, March 16, 2015 at 8:20:50 PM UTC-4, Niphlod wrote:

 I still don't see the need of a dict-like something holding 10m hashes to 
 discern in some 10k lines which one to insert...
 solutions:
 1)
 if the files you're going to insert have less rows than the number of rows 
 in the table, revert the logic: fetch only table rows that could be 
 matching the files. instead of fetching + hashing 10m things, you hash 10k 
 of them
 2)
 choose proper pkeys and code a trigger (ON INSERT). Let the backend do the 
 work (guess what, they're engineered to manage data!), not a single python 
 process that fills the memory
 3)
 store the hash in a separate column (or a separate table). Instead of 
 fetching n rows * number of columns values, and then hash it, you fetch the 
 hashed value already. 

 On Tuesday, March 17, 2015 at 12:14:20 AM UTC+1, LoveWeb2py wrote:

 Thank you for the feedback everyone.

 The main reason I fetch them all first is to make sure I'm not inserting 
 duplicate records. We have a lot of files that have thousands of records 
 and sometimes they're duplicates. I hash a few columns from each record and 
 if the value is the same then I don't insert the record. If there is a more 
 efficient way to do this please let me know.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread LoveWeb2py
Thank you for the advice everyone. Getting a lot of great input.

Dave,

I'm working with a large json file which I'm converting to a dictionary and 
inserting the keys value. I want to use web2py's bulk_insert feature but 
the data has duplicates so I must first remove all the duplicates from the 
json, recreate the dictionary record, append it to a list, and then 
bulk_insert from there. I'm using MySQL is there a preferred way to handle 
bulk_inserts over web2py?

On Monday, March 16, 2015 at 7:58:15 PM UTC-4, Dave S wrote:



 On Monday, March 16, 2015 at 4:14:20 PM UTC-7, LoveWeb2py wrote:

 Thank you for the feedback everyone.

 The main reason I fetch them all first is to make sure I'm not inserting 
 duplicate records. We have a lot of files that have thousands of records 
 and sometimes they're duplicates. I hash a few columns from each record and 
 if the value is the same then I don't insert the record. If there is a more 
 efficient way to do this please let me know.


 Are you doing bulk inserts from files generated elsewhere?  Merging two 
 (or more) databases?

 If you are doing individual inserts, I'd get the maybe-new record in, do a 
 select based on one or more fields in the record, and then do the column 
 hash comparison on the results that were returned.

 For bulk inserts, I'd be inclined to do the import with the DB Engine's 
 management tools, and maybe lean on having the DBE enforce must be unique 
 rules.

 /dps

  

 On Monday, March 16, 2015 at 6:26:50 PM UTC-4, Niphlod wrote:

 I have 300m+ records too, but I don't need to fetch all of those in a 
 single query. 
 It's not a matter of indexes or anything else: the system hang you're 
 incurring to is not the one that the database takes from the moment you 
 send the query to the first row returned, but the time you take to 
 accumulate 1m row into memory.

 On Monday, March 16, 2015 at 10:46:39 PM UTC+1, Dane Wright wrote:

 I have a table which currently contains 10m+ records (local government 
 spending in www.appgov.org). A native SQL count(*) will take 3-5 secs 
 but  reading all the records like this via the DAL will result in the 
 system hanging. I try not to read too many of these records in any one 
 online transaction by allowing only selections and calculating subtotals 
 offline. I also create MySQL indexes outside of Web2py to speed things up 
 where necessary. Of course I also can't ever say db.laspend.id0 in 
 the Database Admin facility either!




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Richard Vézina
My app work well, not seems to have backward issue... I notice an issue
with permission enforcement though, I will look at my code first... And get
back here if I it is not my mistake...

Richard

On Tue, Mar 17, 2015 at 2:49 PM, Richard Vézina ml.richard.vez...@gmail.com
 wrote:

 Working now...

 One thing was I forgot another instance of web2py working... Which seems
 to make it slow before the ui launcher start... But once started the launch
 refuse to start another instance since it was going to use the same port of
 the other... Anyway it works...

 Richard

 On Tue, Mar 17, 2015 at 2:39 PM, Richard Vézina 
 ml.richard.vez...@gmail.com wrote:

 Maybe, though it works with web2py 2.9.5

 I try with command line...

 RIchard

 On Tue, Mar 17, 2015 at 2:25 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 That may be a setting of your machine that if you click on a .py file it
 opens it for edit instead or running it. Actually have the same default
 setting.


 On Tuesday, 17 March 2015 13:15:24 UTC-5, Richard wrote:

 The ui web2py launch don't show up!!

 I download form web2py.com/download : for tester is it the version you
 want us to test?

 Richard

 On Tue, Mar 17, 2015 at 1:55 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 Richard. What do you mean?


 On Tuesday, 17 March 2015 09:59:02 UTC-5, Richard wrote:

 Don't start with double click over web2py.py...

 Richard

 On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
 angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29,
 in module
 You can also download a complete copy from
 http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro 
 massimo.dipie...@gmail.com:
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the Google
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it,
 send an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Setting hidden fields with custom SQLFORMs

2015-03-17 Thread pumplerod
Is there something else which needs to be setup to accomplish this?  I 
currently have...

db.define_table('brands',
Field('brand_name', type='string', requires=IS_NOT_EMPTY(),
  label=T('Brand Name')),
Field('active', type='boolean',
  label=T('active')))

form = SQLFORM(db.brands,hidden=dict(active=True))


However when the form is displayed the field ('active') still shows up 
visible.


On Monday, July 29, 2013 at 6:23:30 PM UTC-5, lesssugar wrote:

 Take a look at the book: 
 http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=hidden+fields#Hidden-fields

 You can try defining your hidden field with *hidden *attribute:

 SQLFORM(..., hidden=dict(hidden_field_name=hidden_field_value))

 It should work.

 On Monday, July 29, 2013 6:47:01 AM UTC+2, davedigerati wrote:

 I've succeeded in using a custom SQLFORM to restrict how many fields of a 
 table the user has to fill out, but now I am trying to set a hidden field 
 value (status) and struggling.

 I tried in the model to use:
 form = SQLFORM(db.games)
 form.vars.status = 'active'

 but the field never gets written to the db, I believe because it is not 
 one of the fields declared in html (below).

 I then tried through the html as 
 {{form.vars.status = 'active'}}
 but while it was in the Accepted form.vars, it doesn't show up in 
 request.vars and again, doesn't get written.

 So, okay, let's place it in the html as 
 {{request.vars.status = 'active'}}
 And now it gets into request.vars, but again is not written to the db.
  
 I think I've sunk over my head on this one, and advice correcting my 
 approach above would be greatly appreciated.
 Or was this a bad path to start down and I should just use a separate 
 operation to write this field to the table after the record is created?
 Thanks,
 Dave

 html if it helps:
 {{=form.custom.begin}}
 {{form.custom.widget.tm_home[_placeholder] = Home Team Name}}
 {{=form.custom.widget.tm_home}}
 {{request.vars.status = active}}   ---  tried variations of this line 
  without it
 {{=form.custom.submit}}
 {{=form.custom.end}}



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-03-17 Thread Dave S


On Monday, March 16, 2015 at 6:57:54 PM UTC-7, DJ wrote:

 Hi Massimo,

 10Biosystems.com has been doing web2Py consulting  bioinformatics product 
 development for lifesciences  healthcare for a few years now. Kindly add 
 us!

 Thanks,
 Sebastian




Is there a website or contact information?  Which region are you located in?

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Massimo Di Pierro
That may be a setting of your machine that if you click on a .py file it 
opens it for edit instead or running it. Actually have the same default 
setting.

On Tuesday, 17 March 2015 13:15:24 UTC-5, Richard wrote:

 The ui web2py launch don't show up!!

 I download form web2py.com/download : for tester is it the version you 
 want us to test?

 Richard

 On Tue, Mar 17, 2015 at 1:55 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 Richard. What do you mean?


 On Tuesday, 17 March 2015 09:59:02 UTC-5, Richard wrote:

 Don't start with double click over web2py.py...

 Richard

 On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
 angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in 
 module
 You can also download a complete copy from http://www.web2py.com.;
 RuntimeError: web2py depends on pydal, which apparently you have not 
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro 
 massimo.dipie...@gmail.com:
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the Google 
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it, 
 send an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google 
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: internal error: [Errno 1] Operation not permitted when attempting Pack All

2015-03-17 Thread LoveWeb2py
Check your file permissions. Are you using windows or linux? 

On Tuesday, March 17, 2015 at 8:17:46 PM UTC-4, Tom Campbell wrote:

 Attempting to do a Manage  Pack All on a project but I get this message:

 messageinternal error: [Errno 1] Operation not permitted: 

 I am attempting to save to the Dropbox directory in which web2py lives. 
 What should to do to get it to pack correctly?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Show busy during AJAX?

2015-03-17 Thread Leonel Câmara
Yeah, just insert an element into the dom with it and then remove or hide 
it when the ajax call is done.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Show busy during AJAX?

2015-03-17 Thread Dave S
Is there an easy way to have the browser show your page is busy during an 
AJAX call?

(I *like* hourglasses.)

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] project hire

2015-03-17 Thread pumplerod
As per above, I wanted to start with OrientDB integration.  I figured that was 
something that the whole comunity could benefit from.  Depending on cost I 
would break out other aspects to be worked on such as orders and credit card 
processing, thrid party API integration, etc...  I have a Bootstrap 3.1 theme 
which I'm in the process of integrating but it's slow going for me and I'd love 
to speed up the progress.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] internal error: [Errno 1] Operation not permitted when attempting Pack All

2015-03-17 Thread Tom Campbell
Attempting to do a Manage  Pack All on a project but I get this message:

messageinternal error: [Errno 1] Operation not permitted: 

I am attempting to save to the Dropbox directory in which web2py lives. 
What should to do to get it to pack correctly?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Setting hidden fields with custom SQLFORMs

2015-03-17 Thread Dave S


On Tuesday, March 17, 2015 at 10:38:18 AM UTC-7, pumplerod wrote:

 Is there something else which needs to be setup to accomplish this?  I 
 currently have...

 db.define_table('brands',
 Field('brand_name', type='string', requires=IS_NOT_EMPTY(),
   label=T('Brand Name')),
 Field('active', type='boolean',
   label=T('active')))

 form = SQLFORM(db.brands,hidden=dict(active=True))


 However when the form is displayed the field ('active') still shows up 
 visible.


The book doesn't have a detailed example at the referenced section 
(although details of what it is translated to are shown).

Do you need quotes around the field name?  
hidden=dict(active=True)
perhaps?

/dps



 


 On Monday, July 29, 2013 at 6:23:30 PM UTC-5, lesssugar wrote:

 Take a look at the book: 
 http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=hidden+fields#Hidden-fields

 You can try defining your hidden field with *hidden *attribute:

 SQLFORM(..., hidden=dict(hidden_field_name=hidden_field_value))

 It should work.

 On Monday, July 29, 2013 6:47:01 AM UTC+2, davedigerati wrote:

 I've succeeded in using a custom SQLFORM to restrict how many fields of 
 a table the user has to fill out, but now I am trying to set a hidden field 
 value (status) and struggling.

 I tried in the model to use:
 form = SQLFORM(db.games)
 form.vars.status = 'active'

 but the field never gets written to the db, I believe because it is not 
 one of the fields declared in html (below).

 I then tried through the html as 
 {{form.vars.status = 'active'}}
 but while it was in the Accepted form.vars, it doesn't show up in 
 request.vars and again, doesn't get written.

 So, okay, let's place it in the html as 
 {{request.vars.status = 'active'}}
 And now it gets into request.vars, but again is not written to the db.
  
 I think I've sunk over my head on this one, and advice correcting my 
 approach above would be greatly appreciated.
 Or was this a bad path to start down and I should just use a separate 
 operation to write this field to the table after the record is created?
 Thanks,
 Dave

 html if it helps:
 {{=form.custom.begin}}
 {{form.custom.widget.tm_home[_placeholder] = Home Team Name}}
 {{=form.custom.widget.tm_home}}
 {{request.vars.status = active}}   ---  tried variations of this line 
  without it
 {{=form.custom.submit}}
 {{=form.custom.end}}



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Richard Vézina
Maybe, though it works with web2py 2.9.5

I try with command line...

RIchard

On Tue, Mar 17, 2015 at 2:25 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 That may be a setting of your machine that if you click on a .py file it
 opens it for edit instead or running it. Actually have the same default
 setting.


 On Tuesday, 17 March 2015 13:15:24 UTC-5, Richard wrote:

 The ui web2py launch don't show up!!

 I download form web2py.com/download : for tester is it the version you
 want us to test?

 Richard

 On Tue, Mar 17, 2015 at 1:55 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 Richard. What do you mean?


 On Tuesday, 17 March 2015 09:59:02 UTC-5, Richard wrote:

 Don't start with double click over web2py.py...

 Richard

 On Tue, Mar 17, 2015 at 10:55 AM, Angelo Compagnucci 
 angelo.compagnu...@gmail.com wrote:

 Hi Massimo,

 I just downloaded the src zip and this is the error output:

 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in
 module
 You can also download a complete copy from http://www.web2py.com
 .
 RuntimeError: web2py depends on pydal, which apparently you have not
 installed.
 Probably you cloned the repository using git without '--recursive'
 To fix this, please run (from inside your web2py folder):

  git submodule update --init --recursive

 You can also download a complete copy from http://www.web2py.com.


 Unfortunately is not a git repository, so it cannot be done!

 Ciao!

 2015-03-17 15:40 GMT+01:00 Massimo Di Pierro 
 massimo.dipie...@gmail.com:
  Can you please help us test the for testers version of web2py?
 
  --
  Resources:
  - http://web2py.com
  - http://web2py.com/book (Documentation)
  - http://github.com/web2py/web2py (Source code)
  - https://code.google.com/p/web2py/issues/list (Report Issues)
  ---
  You received this message because you are subscribed to the Google
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it,
 send an
  email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Getting list of ids of items in a grid?

2015-03-17 Thread Spokes
I'd like to get the id associated with each row of a grid. The grid is 
created like this:

field_names = ['id']
field_list = [f for f in db.t_table1 if f.name in field_names]

query = (db.t_table1.id  0)

grid = SQLFORM.grid(query, fields = field_list, 
orderby = db.t_table1[orderby_field] if orderby_field else 
'random', ... )

What's the best way to obtain a list of the ids?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Getting list of ids of items in a grid?

2015-03-17 Thread Spokes
Dave S - indeed, the only field that will be present in the grid is the id 
field. I've omitted the code that, within that function, changes the 
representation of the id field to something more interesting than just ids. 
This detail probably shouldn't matter for the sake of this question, 
however. Still, I've added an ellipsis to the code in the question to 
reflect that other fields may be present as well.

On Tuesday, March 17, 2015 at 3:25:59 PM UTC-5, Dave S wrote:



 On Tuesday, March 17, 2015 at 12:38:18 PM UTC-7, Spokes wrote:

 I'd like to get the id associated with each row of a grid. The grid is 
 created like this:

 field_names = ['id']
 field_list = [f for f in db.t_table1 if f.name in field_names]
 
 query = (db.t_table1.id  0)
 
 grid = SQLFORM.grid(query, fields = field_list, orderby = 'random', 
 ... )

 What's the best way to obtain a list of the ids?


 I must be missing something, because it looks to me like the code above 
 only gets a list of ids.  The conditional in the list comprehension will 
 only match for one field.

 /dps
  


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Getting list of ids of items in a grid?

2015-03-17 Thread Dave S


On Tuesday, March 17, 2015 at 12:38:18 PM UTC-7, Spokes wrote:

 I'd like to get the id associated with each row of a grid. The grid is 
 created like this:

 field_names = ['id']
 field_list = [f for f in db.t_table1 if f.name in field_names]
 
 query = (db.t_table1.id  0)
 
 grid = SQLFORM.grid(query, fields = field_list, orderby = 'random', 
 ... )

 What's the best way to obtain a list of the ids?


I must be missing something, because it looks to me like the code above 
only gets a list of ids.  The conditional in the list comprehension will 
only match for one field.

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: max size table that DAL can handle?

2015-03-17 Thread Dave S


On Tuesday, March 17, 2015 at 12:03:05 PM UTC-7, LoveWeb2py wrote:

 Thank you for the advice everyone. Getting a lot of great input.

 Dave,

 I'm working with a large json file which I'm converting to a dictionary 
 and inserting the keys value. I want to use web2py's bulk_insert feature 
 but the data has duplicates so I must first remove all the duplicates from 
 the json, recreate the dictionary record, append it to a list, and then 
 bulk_insert from there. I'm using MySQL is there a preferred way to handle 
 bulk_inserts over web2py?


I'm not familiar enough with MySQL, so I'll let somebody else chime in.  
Aside from sqlite, my limited experience is with PostGres, and our class 
didn't get to bulk inserts, aside from initializing our online store with 
SQL statements.  I do rather small bulk inserts in Web2Py by using appadmin 
and csv files.

If you're on a Linux system, is pre-processing the 
duplicates-within-the-file using sort | uniq of any value in reducing the 
bulk?

/dps

 

 On Monday, March 16, 2015 at 7:58:15 PM UTC-4, Dave S wrote:



 On Monday, March 16, 2015 at 4:14:20 PM UTC-7, LoveWeb2py wrote:

 Thank you for the feedback everyone.

 The main reason I fetch them all first is to make sure I'm not inserting 
 duplicate records. We have a lot of files that have thousands of records 
 and sometimes they're duplicates. I hash a few columns from each record and 
 if the value is the same then I don't insert the record. If there is a more 
 efficient way to do this please let me know.


 Are you doing bulk inserts from files generated elsewhere?  Merging two 
 (or more) databases?

 If you are doing individual inserts, I'd get the maybe-new record in, do 
 a select based on one or more fields in the record, and then do the column 
 hash comparison on the results that were returned.

 For bulk inserts, I'd be inclined to do the import with the DB Engine's 
 management tools, and maybe lean on having the DBE enforce must be unique 
 rules.

 /dps

  

 On Monday, March 16, 2015 at 6:26:50 PM UTC-4, Niphlod wrote:

 I have 300m+ records too, but I don't need to fetch all of those in a 
 single query. 
 It's not a matter of indexes or anything else: the system hang you're 
 incurring to is not the one that the database takes from the moment you 
 send the query to the first row returned, but the time you take to 
 accumulate 1m row into memory.

 On Monday, March 16, 2015 at 10:46:39 PM UTC+1, Dane Wright wrote:

 I have a table which currently contains 10m+ records (local government 
 spending in www.appgov.org). A native SQL count(*) will take 3-5 secs 
 but  reading all the records like this via the DAL will result in the 
 system hanging. I try not to read too many of these records in any one 
 online transaction by allowing only selections and calculating subtotals 
 offline. I also create MySQL indexes outside of Web2py to speed things up 
 where necessary. Of course I also can't ever say db.laspend.id0 in 
 the Database Admin facility either!




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: menu - what means the 2nd parameter in tuple?

2015-03-17 Thread Mirek Zvolský
 for styling purposes...
...I'm sorry. I am stupid and cannot read.



Dne pondělí 16. března 2015 19:03:37 UTC+1 Leonel Câmara napsal(a):

 No no no. Like I said it's for styling purposes only. If you don't want 
 the item to be there at all you need to keep doing what you already were 
 doing:

 if auth.has_membership('admin'):
 response.menu.append(...)


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Need help with app configuration -- $

2015-03-17 Thread Michele Comitini
What's the db?

2015-03-17 4:56 GMT+01:00 weheh richard_gor...@verizon.net:

 I need help performance tuning my app. I have budget. The app is python
 2.7.x, web2py latest release, Apache 2.4, mod_wsgi, Windows 7 server. The
 app on the server is running almost many times slower than on dev platform,
 which doesn't use Apache or mod_wsgi. I'm at wits end and need some help
 before the site withers. Feel free to contact me privately or via forum.

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Migrating Passwords

2015-03-17 Thread Júlia Rizza
Thank you for your help. I'll think in a better way to check the passwords 
then, maybe using the web2py version as an API until most of the users 
changed their passwords.

Em segunda-feira, 16 de março de 2015 19:45:40 UTC-3, Niphlod escreveu:

 uhm. web2py's format means 1000 iterations and 20 chars length, with 
 sha512 as hash function.

 the missing variable here is 20 char length... iterations are the 
 same (1000) and so the hash function (sha512).

 from werzeug docs, it seems that the key length is the digest size...which 
 for sha512 is 64.

 not sure if you can migrate them at this point, because werzeug doesn't 
 take into consideration key length as a parameter...(inspecting 
 check_password_hash that in turn is compatible only with what 
 generate_password_hash 
 does).


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Migrating Passwords

2015-03-17 Thread Júlia Rizza
Jorge, since the front-end migrated to Angular and decided to do most of 
the app services on his side, I just wanted to use something smaller and 
simpler, like a micro-framework, considering that I wouldn't need most of 
the web2py tools. Nothing particular with the framework, just a personal 
choice.

Em segunda-feira, 16 de março de 2015 23:35:44 UTC-3, JorgeH escreveu:

 why did you choose to migrate to flask?

 On Monday, March 16, 2015 at 4:38:40 PM UTC-5, Júlia Rizza wrote:

 Hello,

 I'm migrating an app from web2py to Flask and I want to use Werkzeug 
 Security to manage the users passwords, but there is a conflict between the 
 passwords hashes of web2py and Werkzeug.

 Werzeug hash:

 pbkdf2:sha512:1000$salt$hash

 Web2py hash:

 pbkdf2(1000, 20, sha512)$salt$hash

 I can't find a way to migrate the hashes and make Werkzeug understand 
 them.

 Can anybody help me?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Wrong installed apps list in admin

2015-03-17 Thread Massimo Di Pierro
ca you get a directory listing under web2py/applications? I think you have 
accidentally copied something there. I do not see those folders in web2py.

On Monday, 16 March 2015 21:01:49 UTC-5, Roberto Perdomo wrote:

 Hi Everybody, 

 I recently downloaded the latest version of Web2py for Mac and I see a 
 lot of wrong directories in the list of applications  available 
 (admin/default/site). Anyone know the reason of that? 

 Web2py Version: 2.9.12-stable+timestamp.2015.02.15.23.04.25 
 (Ejecutando en Rocket 1.2.6, Python 2.7.3) 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] for Testers

2015-03-17 Thread Massimo Di Pierro
Can you please help us test the for testers version of web2py?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: import_from_csv_file and id_map={}

2015-03-17 Thread Tom Clerckx
Thanks.

I will try to make some time and contribute in that way.

Note:
You may want to update the link to your profile 
on http://web2py.com/init/default/who
-- it results in a page not found.

Best regards,
Tom.

On Wednesday, March 11, 2015 at 7:07:04 PM UTC+1, Tom Clerckx wrote:

 I recently learned (by searching through the google-group) the usefulness 
 of the id_map={} parameter in the db.import_from_csv_file function.
 I was wondering why this is not included in the documentation of web2py?

 Is this on the 'todo' list or is there another reason why it is not 
 included?

 Best regards,
 Tom.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Migrating Passwords

2015-03-17 Thread Massimo Di Pierro
Just be aware of one thing. Flask by default stores sessions in cookies. 
They have a limit of 4K. This means sessions get corrupted or disappear if 
you have large sessions or other cookies from the same domain. So if you 
need sessions I recommend you store them in db.

Massimo

On Tuesday, 17 March 2015 09:02:12 UTC-5, Júlia Rizza wrote:

 Jorge, since the front-end migrated to Angular and decided to do most of 
 the app services on his side, I just wanted to use something smaller and 
 simpler, like a micro-framework, considering that I wouldn't need most of 
 the web2py tools. Nothing particular with the framework, just a personal 
 choice.

 Em segunda-feira, 16 de março de 2015 23:35:44 UTC-3, JorgeH escreveu:

 why did you choose to migrate to flask?

 On Monday, March 16, 2015 at 4:38:40 PM UTC-5, Júlia Rizza wrote:

 Hello,

 I'm migrating an app from web2py to Flask and I want to use Werkzeug 
 Security to manage the users passwords, but there is a conflict between the 
 passwords hashes of web2py and Werkzeug.

 Werzeug hash:

 pbkdf2:sha512:1000$salt$hash

 Web2py hash:

 pbkdf2(1000, 20, sha512)$salt$hash

 I can't find a way to migrate the hashes and make Werkzeug understand 
 them.

 Can anybody help me?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] for Testers

2015-03-17 Thread Angelo Compagnucci
Hi Massimo,

I just downloaded the src zip and this is the error output:

Traceback (most recent call last):
  File web2py.py, line 18, in module
import gluon.widget
  File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in module
You can also download a complete copy from http://www.web2py.com.;
RuntimeError: web2py depends on pydal, which apparently you have not installed.
Probably you cloned the repository using git without '--recursive'
To fix this, please run (from inside your web2py folder):

 git submodule update --init --recursive

You can also download a complete copy from http://www.web2py.com.


Unfortunately is not a git repository, so it cannot be done!

Ciao!

2015-03-17 15:40 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 Can you please help us test the for testers version of web2py?

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Ongoing issue with 'Lost connection to MySQL server during query'

2015-03-17 Thread Ian Ryder
The issue sits with the parent method - it calls a method which takes  300 
seconds, then whatever action is taken with the database in the parent 
method on return blows up.

I think I've cracked it though - and to get there I had to drop the web2py 
scheduler and write my own so I knew what was going on!

Anyway, for anyone else in the same situation (unless web2py handles this 
natively down the track), I basically have to reconnect completely, ie:

   - db = DAL('mysql://XX@mysql.server/xxx', 
   fake_migrate=False, pool_size=10)
   - define all the tables again
   - reload any records I had open in the calling method

I've written the relevant methods to make it all fairly neat...it's not the 
end of the universe and may be the only way but seems clunky...given I've 
been living with this for 2 or 3 months I'm just happy I have an answer 
that seems properly robust ;)

On Tuesday, March 17, 2015 at 1:07:06 AM UTC+11, Paolo Valleri wrote:

 your query takes to much time to be executed and the query goes into 
 timeout.
 From the log I see that you are running a bulk_insert, you can split it 
 into more operations, placing a db.commit between them.
 Mind that in this case the bulk_insert will be executed into few 
 transactions. 

 Otherwise, you can run a custom bulk_insert based on an executesql 
 containing all the inserts. 
 let us know more information about the query.

  Paolo

 2015-03-15 2:01 GMT+01:00 Ian Ryder i.r...@appichar.com.au javascript:
 :

 Thanks Paolo - sadly same result :( I'm not using pyDAL, just the usual 
 Web2py DAL

 ##
  305
 ##
 Traceback (most recent call last):
   File /home/ianryder/yarpr/web2py/gluon/restricted.py, line 224, in 
 restricted
 exec ccode in environment
   File applications/yarpr/models/my_scheduler.py, line 554, in module
 PenguinDoer(db_app)
   File applications/yarpr/models/my_scheduler.py, line 468, in __init__
 debug_log(sys._getframe().f_code.co_name, None, start=method_start, 
 error_details=ee, severity='Fail')
   File applications/yarpr/models/do_debugging.py, line 197, in debug_log
 debug_flush()
   File applications/yarpr/models/do_debugging.py, line 201, in 
 debug_flush
 db_usage.debug_data.bulk_insert(DebugHandler.debug_records)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 9425, in 
 bulk_insert
 ret = self._db._adapter.bulk_insert(self, items)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1376, in 
 bulk_insert
 return [self.insert(table, item) for item in items]
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1361, in insert
 raise e
 OperationalError: (2006, 'MySQL server has gone away')

 Here's the code:
 self.dbase.commit()
 self.dbase._adapter.close(action=None)
 try:
 # now the long running task - in the test it's a sleep for 
 305 seconds.
 run_method(
 *loads(this_task.args, object_hook=self._decode_dict),
 **loads(this_task.vars, object_hook=self._decode_dict)) 
 #, *passed_vars)
 except Exception as ee:
 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 FAILED,
 'Failed: ' + str(ee)
 )
 this_doer.update_record()
 debug_log(sys._getframe().f_code.co_name, None, 
 start=method_start, error_details=ee, severity='Fail')
 raise Exception('Failure during method execution: ' + str(ee))

 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 COMPLETED,
 'Normal exit'
 )




 On Sunday, March 15, 2015 at 12:04:04 AM UTC+11, Paolo Valleri wrote:

 Hi,
 first of all use the latest pydal, it contains a fix when trying to 
 close 'broken connection'.
 Afterwards, for a proper reconnect in your application you should do:
 - db._adapter.close()
 - db._adapter.reconnect()

 If you are looking for an 'auto-reconnect', namely it will re-execute 
 all queries in the broken transaction, I've been working on it, have a look 
 at https://github.com/ilvalle/pydal/tree/auto-reconnect
 In this case it will re-execute all commands in the last transaction 
 (but if you do a db.commit() before the operation, then it is fine). 
 a discussion about this new feature is here: https://groups.google.
 com/d/topic/web2py-developers/e161iZZmp0Y/discussion
 Finally, I've never tried it with mysql, but it should work since 
 an OperationalError is raised.

 Paolo

 On Saturday, March 14, 2015 at 5:50:49 AM UTC+1, Ian Ryder wrote:

 Sorry, formatting was all screwy on the last bit of the OP - 2 
 processing running together, one lasting 295 seconds and saving without 
 issue, the other lasting 305 seconds and failing because the SQL server 
 has 
 gone / isn't reconnected:


 

[web2py] Re: action when leaving a page

2015-03-17 Thread Gray Kanarek
The variables I'm trying to store are the gamestate and character 
information for a game. If I do this, it exposes that information in the 
source of the page, and could theoretically be editable by the user 
(correct?). Even if it's not editable, it's a sizable amount of code, and 
it also changes (usually) with every ajax call to submit a new command to 
the game. 

I don't know enough about javascript to tell (a) if there's a way to 
disguise the variables, or make them disappear completely, and (b) how to 
update them once the ajax magic happens. I believe my case is a perfect use 
of (current.)session... but I'd prefer to have the gamestate  character 
clear when the user navigates away from the play page, which won't happen 
automatically.

I don't know enough about the scope of current.response and 
current.request... might either of these be used to better advantage than 
current.session?

On Monday, March 16, 2015 at 10:35:57 AM UTC-4, Leonel Câmara wrote:

 Why don't you store the variable in a javascript variable and send it in 
 every ajax request instead? 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLForms DAL error

2015-03-17 Thread pumplerod
Sorry, I'm a bit confused.  I'm under the impression the db=DAL(...) line 
simply tells web2py which database I will be using.  Then I use 
db.define_table to create the table.  All of this seems to work because I 
do see the table listed within the databases directory.  When I try and 
reference it however I get the error.  As far as I can tell there is only 
one reference to db=DAL(...) in my code.

On Sunday, March 15, 2015 at 4:24:15 PM UTC-5, pumplerod wrote:

 I've found others with this similar error, however the solutions don't 
 seem to apply as far as I can tell in my simplified instance...

 # db.py
 db = DAL('sqlite://storage.sqlite')
 db.define_table('brands',
 Field('brand_name', type='string', requires=IS_NOT_EMPTY(),
   label=T('brand_name')),
   migrate=True)

 # in the controller.py
 def brand():
 form = SQLFORM(db.brands)
 return dict(form=form)

 # in the brand.html
 {{extend 'layout.html'}}
 h2{{=T( request.args(0).replace('_',' ').capitalize() )}}/h2
 div id=brand_form
 {{
 =form
 }}
 /div

 I get this error:

 AttributeError: 'DAL' object has no attribute 'brands'


 I think I've boiled this down as simple as I can.  the table does indeed 
 exist.  I'm sure I'm missing something very basic.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] dbio=False proper way to update every fields not only the one that had changed

2015-03-17 Thread Richard Vézina
Finally, I figured out!!

My compute need the record id, so I shouldn't do this :

if f != db[request.args(0)]._id

To filter out the record id from the update... I have been miss leading by
some example, but I can't recall where they were from, I just search bit
and can't retrieve any (neither from book and from sqlhtml.py)...

Anyway, it works now...

:)

Richard

On Fri, Mar 6, 2015 at 3:11 PM, Niphlod niph...@gmail.com wrote:

 IMHO the hiccup comes from the fact that fields that are writable =
 False are not rendered as an input/select/whatever, but they're just a TD
 cell filled with data. Of course the form isn't submitting it.

 On Friday, March 6, 2015 at 4:19:35 PM UTC+1, Anthony wrote:

 No, the compute field should not be in the form/form.vars. Hard to say
 what the problem is. Maybe create a minimal app that reproduces the problem.

 Anthony

 On Friday, March 6, 2015 at 8:58:23 AM UTC-5, Richard wrote:

 Yah right!


 row = db[request.args(0)](request.args(1))
 for f in db[request.args(0)].fields:
 if f != db[request.args(0)]._id and f !=
 db[request.args(0)].record_review_status:
 form.vars[f] = form.vars.get(f, row[f])


 My table is kind of not normalized... Many fields are just showed (not
 writeable) and the user check a box to review them... These records are
 missing, but they are not all required for the compute to work.

 Should my compute have to be in the form.vars to compute?

 Should I explicitly have to redifined it or append it like so :

 form.vars[mycompute] = db.table.mycompute.compute

 ?

 Richard

 On Thu, Mar 5, 2015 at 5:14 PM, Anthony abas...@gmail.com wrote:

 On Thursday, March 5, 2015 at 4:18:06 PM UTC-5, Richard wrote:

 Yes I struggle with it to make compute works...

 I come up with something like this :

 after .accepted

 for f in db[request.args(0)].fields:
 if f != db[request.args(0)]._id and f !=
 db[request.args(0)].record_review_status:
 form.vars[f] = form.vars.get(f,
 db[request.args(0)](request.args(1))[f])


 If it is an update form, all the fields should be in the form already
 (unless they were explicitly excluded from the form). Also, the above does
 a separate database select for every missing field -- it would be better to
 fetch the record just once and then read the fetched record.

 Anthony

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: action when leaving a page

2015-03-17 Thread Leonel Câmara
Well if the game is in javascript and running on people's browser they 
could theoretically do all the cheats they want anyway.

You could use window.onbeforeunload to delete the data when the user leaves 
a page, but that wouldn't help if the user opens another page in a new tab 
that deletes your session.

I think you need to give us more information on what exactly is going on 
and what you're trying to achieve.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLForms DAL error

2015-03-17 Thread pumplerod
My Mistake.  I did indeed find the db=DAL(...) elsewhere located.  Thank 
you so much for letting me know what to look for.



On Sunday, March 15, 2015 at 4:24:15 PM UTC-5, pumplerod wrote:

 I've found others with this similar error, however the solutions don't 
 seem to apply as far as I can tell in my simplified instance...

 # dp.py
 db = DAL('sqlite://storage.sqlite')
 db.define_table('brands',
 Field('brand_name', type='string', requires=IS_NOT_EMPTY(),
   label=T('brand_name')),
   migrate=True)

 # in the controller.py
 def brand():
 form = SQLFORM(db.brands)
 return dict(form=form)

 # in the brand.html
 {{extend 'layout.html'}}
 h2{{=T( request.args(0).replace('_',' ').capitalize() )}}/h2
 div id=brand_form
 {{
 =form
 }}
 /div

 I get this error:

 AttributeError: 'DAL' object has no attribute 'brands'


 I think I've boiled this down as simple as I can.  the table does indeed 
 exist.  I'm sure I'm missing something very basic.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.