Re: [web2py] Re: Saving incomplete form with required fields (to prevent dynamically added form inputs from disappear

2013-11-26 Thread Mark Li
Yep, the "finished" field will prevent the unfinished records from being exposed where they shouldn't be. On Mon, Nov 25, 2013 at 11:15 AM, Dave S wrote: > On Saturday, November 23, 2013 11:44:05 PM UTC-8, Mark Li wrote: >> >> I think I've found an optimal solution for this. >> >> Since the va

[web2py] Re: Strange Issue with Executesql

2013-11-26 Thread Brian M
Querying out 47K rows is taking 4.5-5.5 seconds on my laptop (and its specs are nothing special). Not sure how the complexity of my query compares to yours but 20-150 seconds seems slow. Heck I can get back over 800K rows in about 75 seconds. BTW, running the same queries in SQL Server Managemen

[web2py] Re: Formatting the Time Field

2013-11-26 Thread Dave S
On Tuesday, November 26, 2013 4:16:49 PM UTC-8, Jesse Ferguson wrote: > > Having a hard time figuring out this one and after googling my eyeballs > off Im here to beg for someone to throw me a bone, here is my code: > > MODEL: > > db.define_table('timecard_entry', > Field('timecard

[web2py] Re: Files toggle sidebar pop-up on initial page load

2013-11-26 Thread Massimo Di Pierro
I find it annoying too. Perhaps the default behavior should be for it to stay closed. On Tuesday, 26 November 2013 21:16:13 UTC-6, Bogdan Nechita wrote: > > Hello, > > In the admin web2py OOB application, when you edit a file, the "Files > Toggle" sidebar pops up every time on initial page load

[web2py] Re: Web2py on ARM8 V5 embedded systems, how much RAM needed to run properly

2013-11-26 Thread Massimo Di Pierro
It should run, with or without rocket. Let us know. On Tuesday, 26 November 2013 09:44:17 UTC-6, István Györfi wrote: > > Hello dear web2py users ! > > First of all, sorry about my bad english. > > We want to develope a small server application to an ARM8 V5 embedded > system with a Linux distrib

[web2py] Files toggle sidebar pop-up on initial page load

2013-11-26 Thread Bogdan Nechita
Hello, In the admin web2py OOB application, when you edit a file, the "Files Toggle" sidebar pops up every time on initial page load. Does anyone know if there is a setting/code change I could make to stop the sidebar from popping up? I looked through the js code that loads with the edit page

[web2py] Formatting the Time Field

2013-11-26 Thread Jesse Ferguson
Having a hard time figuring out this one and after googling my eyeballs off Im here to beg for someone to throw me a bone, here is my code: MODEL: db.define_table('timecard_entry', Field('timecard', 'reference timecard', readable=False, writable=False,), Field('c

[web2py] Running Scheduler in Openshift with Web2py

2013-11-26 Thread Boris Aguilar
Hi I'm currently running web2py in an openshift instance using [1] But I'm quite unsure of how to run the scheduler (needed by mi application) within the instance of openshift. Any help I'll be very thankful :) [1] https://github.com/prelegal

[web2py] Web2py on ARM8 V5 embedded systems, how much RAM needed to run properly

2013-11-26 Thread István Györfi
Hello dear web2py users ! First of all, sorry about my bad english. We want to develope a small server application to an ARM8 V5 embedded system with a Linux distribution. The hardware have only 64MB of RAM. Max 1-2 user browsing at the same time (it will be a setup application for the device).

[web2py] Re: how to hide the [wiki] menu option in auth.wiki

2013-11-26 Thread Calvin
I'm using web2py 2.7.4-stable+timestamp.2013.11.25.15.21.21 but it doesn't appear that the patch for this is in yet. However, instead of doing the removal of the Wiki link with jQuery on the client, which is susceptible to being hacked by a savvy user, the following may be more secure: To th

[web2py] Re: Form self-submit broken after redirection

2013-11-26 Thread weheh
Sorry for the slow response. From within my main view, at the end, I do this: $(document).ready(function() { {{if auth.is_logged_in() and session.state:}} $("#mydialog").dialog("open"); web2py_component("{{= URL('mycontroller', 'index')}}", "mydial

[web2py] LDAP Auth

2013-11-26 Thread Maggs
I am in this situation where my team is in the process of migrating our ldap servers to the vpc and as a result I must update my applications to use secure ldap. I have unfortunately run into an issue with ldap_auth where it will use secure ldap but it only takes a ca cert file, but I need to u

[web2py] Insert many-to-many

2013-11-26 Thread Eduardo Cruz
You can get all the many to many relationship with table.many_to_many_.select() but is there a way to insert the relationship when you create the row? like db.table.insert(dict(field1=1, field2=2, manytomanytable={x_id}) ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentatio

[web2py] Re: FDB (firebird) adapter can't store blobs greater than 64k

2013-11-26 Thread Jose
Hi, I was watching this. I have a little dizzy with the code. Now I can not prove. The solution is to redefine "represent_exceptions" in FireBirdAdapter? It is that way? José -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source c

[web2py] Re: jsonify equivalent in web2py

2013-11-26 Thread Pearu Peterson
Perfect! That's exactly what I needed. To be exact, `jsonify(**data)` is equivalent to `json(data)`. Thanks, Pearu On Tuesday, November 26, 2013 10:54:30 PM UTC+2, Niphlod wrote: > > from gluon.serializers import json > > def whatever(): > return json(object) > > > On Tuesday, November 26,

[web2py] Re: jsonify equivalent in web2py

2013-11-26 Thread Niphlod
from gluon.serializers import json def whatever(): return json(object) On Tuesday, November 26, 2013 9:26:04 PM UTC+1, Pearu Peterson wrote: > > Hi, > > I am trying to merge sphinx generated documents to a web2py application > using sphinx.websupport [1]. > I am stuck to get commenting wor

[web2py] Cron job every 30 seconds

2013-11-26 Thread melmg
Is is possible to set up a cron job to run every 30 seconds instead of a minute? I have a function that does an HTTP GET request to retrieve some values from another server (a small server running on a microcontroller) and then saves those values in the database. I want to run this function eve

[web2py] jsonify equivalent in web2py

2013-11-26 Thread Pearu Peterson
Hi, I am trying to merge sphinx generated documents to a web2py application using sphinx.websupport [1]. I am stuck to get commenting working. Namely, according to [1], a _get_comment controller ought to return jsonify object when using flask. My question is what would be jsonify(..) equivalent

Re: [web2py] web2py routes.py

2013-11-26 Thread Dave S
On Tuesday, November 26, 2013 8:51:45 AM UTC-8, Gael Princivalle wrote: > > It's really strange. > > I've try this example from the manual: > routes_in = ( > ('/testme', '/examples/default/index'), > ) > routes_out = ( > ('/examples/default/index', '/testme'), > ) > > On the first time I lo

[web2py] Re: uwsgi threads

2013-11-26 Thread Massimo Di Pierro
Threads make things slower (if you have multiple cores) but prevent one client to hang the server and affect others. You do it for concurrency, not for parallelization. On Tuesday, 26 November 2013 01:00:35 UTC-6, Jayadevan M wrote: > > The script > > https://github.com/web2py/web2py/blob/maste

Re: [web2py] calling controller from view to retrieve data

2013-11-26 Thread Yebach
You mean I insert the controller code into model? -- 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 t

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
On Tue, Nov 26, 2013 at 10:22 PM, Ricardo Pedroso wrote: > > > > On Tue, Nov 26, 2013 at 4:44 PM, Saurabh Kumar wrote: > >> I am NOT comparing the static files and dynamic requests. I was just >> illustrating the behaviour I am expecting wrt concurrency. I understand how >> Linux kernel and Apache

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
I think l should first try lazy loading and other stuff. I hope that it should work that way. On Tue, Nov 26, 2013 at 10:18 PM, Leonel Câmara wrote: > 100 table definitions make it look like this project scope has grown a > little bit too big. Have you considered breaking the project into more t

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Ricardo Pedroso
On Tue, Nov 26, 2013 at 4:44 PM, Saurabh Kumar wrote: > I am NOT comparing the static files and dynamic requests. I was just > illustrating the behaviour I am expecting wrt concurrency. I understand how > Linux kernel and Apache works to some extent. > > > All I am trying to do is *25* light conc

Re: [web2py] web2py routes.py

2013-11-26 Thread Gael Princivalle
It's really strange. I've try this example from the manual: routes_in = ( ('/testme', '/examples/default/index'), ) routes_out = ( ('/examples/default/index', '/testme'), ) On the first time I load www.mydomain.com I've examples application on root, and if I click on some menu items I tu

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
On Tue, Nov 26, 2013 at 10:14 PM, Ricardo Pedroso wrote: > And to see how much you loose when doing dynamic serving against static > content serving, just create a web2py > application with only one file: > > models/0.py: > > raise HTTP(200, 'OK') > > > Yes, I tried something similar and it worked

[web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Leonel Câmara
100 table definitions make it look like this project scope has grown a little bit too big. Have you considered breaking the project into more than one web2py application? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
I am NOT comparing the static files and dynamic requests. I was just illustrating the behaviour I am expecting wrt concurrency. I understand how Linux kernel and Apache works to some extent. All I am trying to do is *25* light concurrent requests [in which controller looks like the following] with

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Ricardo Pedroso
And to see how much you loose when doing dynamic serving against static content serving, just create a web2py application with only one file: models/0.py: raise HTTP(200, 'OK') On Tue, Nov 26, 2013 at 4:40 PM, Anthony wrote: > I think as you say the problem is with table definition code, whi

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Anthony
> > I think as you say the problem is with table definition code, which I am > trying to sort out. If you have any other suggestions regarding the same > (speeding up and concurrency) please let me know. I am really thankful to > all of you for helping me out :) > See third bullet here: http:

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Ricardo Pedroso
> > On Tue, Nov 26, 2013 at 8:42 PM, Ricardo Pedroso wrote: > >> How may cores do you have? >> Are all the cores being used when you run the tests? >> What webserver are you testing against? >> >> > I have 4 cores, 16 GB RAM running Apache. But I think, this is irrelevant. > Apache easily serves 10

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Anthony
> In both cases above, 50 requests were completed. In the case of >> concurrency=25, however, the 50 requests were completed faster (i.e., 3.46 >> seconds vs. 5.79 seconds in the serial case). So, with concurrent requests, >> the time per request dropped from 115ms to 69ms. Did you expect it t

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
On Tue, Nov 26, 2013 at 9:32 PM, Anthony wrote: > >>> ab -n 50 -c 1 [url] >>> >>> >> Concurrency Level: 1 >> Time taken for tests: 5.791 seconds >> Time per request: 115.813 [ms] (mean) >> Time per request: 115.813 [ms] (mean, across all concurrent >> requests) >> > > >> ab -n

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Anthony
> > >> ab -n 50 -c 1 [url] >> >> > Concurrency Level: 1 > Time taken for tests: 5.791 seconds > Time per request: 115.813 [ms] (mean) > Time per request: 115.813 [ms] (mean, across all concurrent > requests) > > ab -n 50 -c 25 [url] >> >> Concurrency Level: 25 > Time ta

Re: [web2py] Crypto()

2013-11-26 Thread Marco Dellachiesa
Now I get the point! Thank you very much Jonathan. Marco Sent from my iPad > On 26/nov/2013, at 16:41, Jonathan Lundell wrote: > >> On 26 Nov 2013, at 2:05 AM, Mchurch wrote: >> >> Dear all, I'm a little bit lost with Crypto method. >> I need authentication from a mobile app towards web2py. >>

[web2py] Re: Unable to create Auth tables

2013-11-26 Thread Julien Courteau
It works! Thanks a lot Anthony! On Monday, November 25, 2013 9:34:18 PM UTC-5, Anthony wrote: > > web2py thinks it already created those tables (you dropped them outside of > web2py, so it doesn't know they're gone). Try removing the associate > *.table files in the /databases folder (they store

Re: [web2py] calling controller from view to retrieve data

2013-11-26 Thread Jonathan Lundell
On 26 Nov 2013, at 4:33 AM, Yebach wrote: > I menage to call my function that is in my default.py controler from my view > but I cannot retrieve data that this function is suppose to retrieve > > function is called on button click to load some text from database into ACE > editor > > this

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
Here is the output of the two commands and one with -n 500 -c 100. I think as you say the problem is with table definition code, which I am trying to sort out. If you have any other suggestions regarding the same (speeding up and concurrency) please let me know. I am really thankful to all of you

Re: [web2py] Crypto()

2013-11-26 Thread Jonathan Lundell
On 26 Nov 2013, at 2:05 AM, Mchurch wrote: > Dear all, I'm a little bit lost with Crypto method. > I need authentication from a mobile app towards web2py. > If I'm not in wrong, web2py now uses sha512 as default to crypt auth user > password. > From my iOS app I'm sending the password encrypted

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Anthony
Are you comparing how long it takes to do 25 requests done in parallel to how long it takes to do 25 requests serially, or are you comparing how long it takes to do 25 request in parallel to how long it takes to do 1 request all by itself? You seem to be making the latter comparison and expectin

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
On Tue, Nov 26, 2013 at 8:42 PM, Ricardo Pedroso wrote: > How may cores do you have? > Are all the cores being used when you run the tests? > What webserver are you testing against? > > I have 4 cores, 16 GB RAM running Apache. But I think, this is irrelevant. Apache easily serves 1000 static file

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Ricardo Pedroso
How may cores do you have? Are all the cores being used when you run the tests? What webserver are you testing against? Keep in mind that one core can only process one instruction (machine code, not python instruction) at a time. Ricardo On Tue, Nov 26, 2013 at 2:32 PM, Saurabh Kumar wrote: >

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
On Tue, Nov 26, 2013 at 7:27 PM, Anthony wrote: > *Case 1:* >> Number of Tables in db.py: ~100 (all with migrate=False) >> No. of concurrent requests: 1 >> Time taken per request: 900 ms >> >> *Case 2:* >> Number of Tables in db.py: ~100 (all with migrate=False) >> No. of concurrent requests: 25

[web2py] Re: Update while iterating over fields

2013-11-26 Thread Anthony
On Tuesday, November 26, 2013 2:51:17 AM UTC-5, Yohai Bar Sinai wrote: > > Combining Anthony's and Massimo's answers, the correct code is > > db(query).update(**{'x'+str(i):db.X['x'+str(i)]+10}) > > 'x' + str(i) is certainly simpler, but technically should be equivalent to what you had (i.e., db.X

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Anthony
> > On Tue, Nov 26, 2013 at 2:44 AM, Anthony >wrote: > >> So, is time for 25 concurrent requests significantly greater than >> 25*[time for a single request]? >> >> > No, time for 25 concurrent requests is smaller than 25*[time for a single > request]. > Avg. time taken per request is 4 to 5 t

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Anthony
> > *Case 1:* > Number of Tables in db.py: ~100 (all with migrate=False) > No. of concurrent requests: 1 > Time taken per request: 900 ms > > *Case 2:* > Number of Tables in db.py: ~100 (all with migrate=False) > No. of concurrent requests: 25 > Time taken per request: 4440 ms > For apples to app

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
On Tue, Nov 26, 2013 at 2:44 AM, Anthony wrote: > So, is time for 25 concurrent requests significantly greater than 25*[time > for a single request]? > > No, time for 25 concurrent requests is smaller than 25*[time for a single request]. Avg. time taken per request is 4 to 5 times though. They sh

Re: [web2py] Re: Web2py DAL slows down the server response when faced with multiple concurrent requests

2013-11-26 Thread Saurabh Kumar
I am sorry if I failed to put it clearly or I am asking something absurd. I am not sure why are you relating it to the Mysql server. I am summarizing my observations below. *Context:* I am testing using ab. The HTTP request does not make any database query. Number of Daemon processes: 10 Max Numb

[web2py] calling controller from view to retrieve data

2013-11-26 Thread Yebach
Hello I menage to call my function that is in my default.py controler from my view but I cannot retrieve data that this function is suppose to retrieve function is called on button click to load some text from database into ACE editor this is some of my code in controler.py def load_last(

[web2py] Crypto()

2013-11-26 Thread Mchurch
Dear all, I'm a little bit lost with Crypto method. I need authentication from a mobile app towards web2py. If I'm not in wrong, web2py now uses sha512 as default to crypt auth user password. >From my iOS app I'm sending the password encrypted with the same Hash Algorithm sha512, because I don't

[web2py] disk cache problem

2013-11-26 Thread szimszon
http://code.google.com/p/web2py/issues/detail?id=1791&thanks=1791&ts=1385453629 I have an app with lot of disk cache usage in selects after 2.7 - don't know exactly the exact version :( - I got a lot of trouble with it, sometimes the app just wait and if I try disk. Or if I make a cache.disk.f