[web2py] Database access without DAL but with connection pool

2014-03-19 Thread tech . uz
Dear Sirs, I understand it's possible to use databases without DAL. For example function in controller: def values(): client = pymongo.MongoClient('localhost', 27017) db = client.mybase mytable = db[mytable] res = mytable.find() . return dict() And of course it

[web2py] I am trying to build a page to display video files list with thumbnail like youtube do.

2014-03-19 Thread Ravi
Hi ! I am new to web2py and python and trying to build a page to display video files list with thumbnail like youtube do. I am using Expose to display files and folder in a browser .its working fine. but how to add/display thumbnail with each video files contain in a directory. what should

Re: [web2py] Python Performance Issue, Part 2

2014-03-19 Thread Michele Comitini
if threads=0 does not work use threads=1 and make mod_wsgi happy. If you remove threads it defaults to 15. 2014-03-19 4:34 GMT+01:00 horridohobbyist horrido.hobb...@gmail.com: threads=0 is no good–Apache restart upchucks on this. BTW, I haven't experimented with the threads value. Might this

Re: [web2py] Python Performance Issue, Part 2

2014-03-19 Thread Tim Richardson
Did you explicitly set the number of threads as well? By default you get 15 threads per process. The documentation implies that this is a hard limit, but I'm not sure. Maybe you have simply found a bottleneck in threads. Did you also try increasing the number of threads instead of adding more

Re: [web2py] Python Performance Issue, Part 2

2014-03-19 Thread Michele Comitini
Multi-threaded apache is supposed to be faster than multi-process apache under real load (i.e. multiple users) because starting processes is expensive in time and memory. IMHO under linux the difference is really negligible. Popularity of threads rose in mid '90 because a very popular OS

Re: [web2py] pysimplesoap help

2014-03-19 Thread piero crisci
Hi mariano i still got some problem I solved the problem with the basic authentication but i still have some problem on calling webservice. The webservice infact need a first call for the db connection ('init' ) After this call you can call the other services. I made this code : from

Re: [web2py] Python Performance Issue, Part 2

2014-03-19 Thread horridohobbyist
Yes, processes=3 and threads=1. I tried processes=1 and threads=3, and performance was still 10x bad. So I guess that answers my question: the threads parameter is not helpful. On Wednesday, 19 March 2014 05:24:01 UTC-4, Tim Richardson wrote: Did you explicitly set the number of threads as

Re: [web2py] 504 Gateway Time-out

2014-03-19 Thread Johann Spies
I have had that. As I understand it, this happens when it takes longer to get the answer from uwsgi than was specified in the parameter uwsgi_read_timeout Try increasing the timeout or do something to speedup your query or both... Regards Johann On 19 March 2014 00:53, António Ramos

Re: [web2py] Python Performance Issue, Part 2

2014-03-19 Thread horridohobbyist
In 2007, I wrote my first web application using Smalltalk/Seaside. I chose Seaside because it was a very easy-to-learn, easy-to-program, easy-to-deploy, highly productive, self-contained all-in-one web framework. (It still is, today.) Unfortunately, web2py hadn't been born yet, but clearly the

[web2py] howto: ajax call in FORM with signed URL

2014-03-19 Thread Mike Constabel
Hi, in a form i have TD(INPUT(_id='keyword', _name='keyword', _onkeyup=ajax(URL('callback', ['keyword', 'stype']), 'target');), _name=search_type))) If a text is entered, callback is called an some text is displayed in target. This works. But now I want to sign the URL. If I add

Re: [web2py] calling download function page by ajax

2014-03-19 Thread Richard Vézina
Thanks for suggestion! Richard On Wed, Mar 19, 2014 at 1:23 AM, Limedrop russ...@holtrd.com wrote: Posted to soon. To clarify, the cookies need to be set in your download function: {{view}} response.files.append(URL('static','jquery.fileDownload/jquery.fileDownload.js'))

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread Massimo Di Pierro
I am not sure about pymongo but if you use DAL('mongodb:') the dal will do pooling for you. On Wednesday, 19 March 2014 01:33:04 UTC-5, tec...@gmail.com wrote: Dear Sirs, I understand it's possible to use databases without DAL. For example function in controller: def values():

[web2py] REF: Downloading static files with spaces gives an error

2014-03-19 Thread Teddy Nyambe
I have trying to download files stored in static/upload/my file.pdf, it returns page not found. But when i remove spaces and change the static file, it works. Any ideas on why this behaviour or explanation? --

Re: [web2py] pysimplesoap help

2014-03-19 Thread Mariano Reingart
Could you send me the content of client.response (http headers)? Maybe it is returning a cookie or something equivalent Then, you can update client.http_headers with them and it should work Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Wed, Mar

[web2py] Re: dashboard using bootstrap

2014-03-19 Thread Anubhav Singh
hi Massimo Di Pierro, this is very useful for bootstrap user . thanks for post... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] uploading a csv file and read it with python module pandas

2014-03-19 Thread Gaston
I am statistician and new in web2py. I tried to build an application that allows users to: - upload a csv file in the database (my file) - and click a link where some automated analyses have been attached using the python module pandas with (import pandas as pd) In the db.py, I have

[web2py] Boots trap user graph

2014-03-19 Thread Anubhav Singh
hi guys, is there any easy script for create a user log graph . if yes please help me because i have little knowledge of j-query . while i was searching on google there are all result come with j-query and also with very difficult script .. help me please ... thanks 2 all --

Re: [web2py] calling download function page by ajax

2014-03-19 Thread Richard Vézina
I found this workaround : response.js = window.open('%(url1)s'); window.open('%(url2)s'); % {'url1': URL(c='controller', f='func1', extension=False, vars=dict(var1=var1, **var2_dict)), 'url2': URL(c='controller', f='func2', extension=False, vars=dict(var1=var1))} As one of the suggestion of

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread tech . uz
Hello Massimo, Thank you for reply. On Wednesday, March 19, 2014 7:20:27 PM UTC+5, Massimo Di Pierro wrote: I am not sure about pymongo but if you use DAL('mongodb:') the dal will do pooling for you. Ok, I will check this. Actually I don't want to use pymongo only, it could any

[web2py] Re: REF: Downloading static files with spaces gives an error

2014-03-19 Thread LightDot
Vital parts of information are missing - are the files served by Rocket , Apache, or..? How is the file being downloaded? By a browser request? How is the request formulated, are you following a link or entering the URL by typing it directly? Regards On Wednesday, March 19, 2014 3:24:03 PM

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread LightDot
Well, if you want to do it without the DAL, there are several options that might just work without any additional code: - check if specific python libs that you'll use for the db connection already provide a similar pooling function, they might - check if the database backend natively provides

Re: [web2py] pysimplesoap help

2014-03-19 Thread piero crisci
*this is the client obj* client = SoapClient( location=location_wsdl, wsdl=wsdl, ns = ns, sessions=True, trace=True, http_headers={'Authorization': Basic %s % auth},username=username,password=password) client['AuthHeaderElement'] = {'Authorization': Basic %s % auth} client['http_header'] =

[web2py] Re: howto: ajax call in FORM with signed URL

2014-03-19 Thread LightDot
Try: TD(INPUT(_id='keyword', _name='keyword', _onkeyup=ajax(URL('callback', ['keyword', 'stype'], user_signature=True), 'target');), _name= search_type))) Regards On Wednesday, March 19, 2014 1:59:38 PM UTC+1, Mike Constabel wrote: Hi, in a form i have TD(INPUT(_id='keyword',

Re: [web2py] pysimplesoap help

2014-03-19 Thread Mariano Reingart
This should work: *# call the autentication remote method:* *client.call('init',('host','localhost'),('port','4859'),('user','CRSPRIX),('password',''),('pnumber',''),('db','XX'),('encoding',None),('titlePageSize',10),('indexPageSize',10)) * *# set the cookie* *client.http

Re: [web2py] pysimplesoap help

2014-03-19 Thread piero crisci
Yes it works! Il giorno mercoledì 19 marzo 2014 17:51:42 UTC+1, Mariano Reingart ha scritto: Sorry, I forgot the underscore in http_headers in the set th cookie part *client.http_headers['Cookie'] = client.response['set-cookie']* Regards, Mariano Reingart

Re: [web2py] pysimplesoap help

2014-03-19 Thread Mariano Reingart
Sorry, I forgot the underscore in http_headers in the set th cookie part *client.http_headers['Cookie'] = client.response['set-cookie']* Regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Wed, Mar 19, 2014 at 1:50 PM, Mariano Reingart

[web2py] Re: Need a instruction for Rating Plugin

2014-03-19 Thread José Leite
Hello, I tried to use this plugin, but the stars are not appearing!!! Anyone knows what may be the problem? Sábado, 14 de Janeiro de 2012 6:01:27 UTC, kenji4569 escreveu: Thanks for your blog post! On 1月14日, 午前3:55, Omi Chiba ochib...@gmail.com wrote: It easy to use and works great

Re: [web2py] Pulling data every 30s for a ticker with web2py

2014-03-19 Thread Martin
Le lundi 17 mars 2014 14:21:27 UTC+2, Ramos a écrit : does this help? http://vimeo.com/27478796 2014-03-16 17:48 GMT+00:00 Martin kurl...@gmail.com javascript:: Hi all, Please could anyone help me out, I need to pull some data from some API (ex: https//xxx/aaa/ etc.) every 30s and

[web2py] Field.label=lambda ... possible?

2014-03-19 Thread Kiran Subbaraman
Hello, I am creating a SQLFORM.grid(), and in the update-form for that grid, I want to display the label value by computing it. Basically, I have this: model: db.define_table('x', Field('p', type='string'), Field('q', type='string') ) controller: if blah: db.x.q.label

[web2py] Re: Field.label=lambda ... possible?

2014-03-19 Thread Anthony
The label is used to label an entire column, so it wouldn't make sense to calculate a different label for every record. What exactly are you trying to do? On Wednesday, March 19, 2014 2:54:22 PM UTC-4, Kiran Subbaraman wrote: Hello, I am creating a SQLFORM.grid(), and in the update-form for

[web2py] Re: Field.label=lambda ... possible?

2014-03-19 Thread Kiran Subbaraman
Thanks, that makes sense. What am trying to do is this... *model* db.define_table('x', Field('p', type='string'), Field('q', type='string'), Field('r', type='text') ) This will be displayed in a SQLFORM.grid, with the following caveats: 1. I do not want to see columns for p,

[web2py] Re: Field.label=lambda ... possible?

2014-03-19 Thread Anthony
def mygrid(): if 'edit' in request.args: db.x.p.writable = False db.x.r.readable = db.x.r.writable = False else: db.x.p.readable = db.x.q.readable = db.x.r.readable = False return dict(grid=SQLFORM.grid(db.x, ...) On Wednesday, March 19, 2014 3:41:09 PM UTC-4,

Re: [web2py] Re: REF: Downloading static files with spaces gives an error

2014-03-19 Thread Teddy Nyambe
Rocket and will eventually deploy on apache. It will be a link pointing to a file and when someone clicks should prompt a save On 19 Mar 2014 17:05, LightDot light...@gmail.com wrote: Vital parts of information are missing - are the files served by Rocket , Apache, or..? How is the file being

[web2py] Re: Field.label=lambda ... possible?

2014-03-19 Thread Kiran Subbaraman
Anthony, Thank you :-) Kiran On Thursday, March 20, 2014 1:51:15 AM UTC+5:30, Anthony wrote: def mygrid(): if 'edit' in request.args: db.x.p.writable = False db.x.r.readable = db.x.r.writable = False else: db.x.p.readable = db.x.q.readable = db.x.r.readable

[web2py] Re: howto: ajax call in FORM with signed URL

2014-03-19 Thread Niphlod
you're missing a point: separation of what is executed by python and what is executed by javascript. user_signature takes into consideration a/c/f , args AND vars. your URL link in the onkeyup attribute is generated by python, but then ajax() takes the values presented in the form (in your

[web2py] Re: howto: ajax call in FORM with signed URL

2014-03-19 Thread Mike Constabel
Doesn't work. The generated HTML code: input id=keyword name=keyword onkeyup=ajax(URL(#x27;callback#x27;, [#x27;keyword#x27;, #x27;stype#x27;], user_signature=True), #x27;target#x27;); type=text / Am Mittwoch, 19. März 2014 16:31:41 UTC+1 schrieb LightDot: Try: TD(INPUT(_id='keyword',

[web2py] Re: howto: ajax call in FORM with signed URL

2014-03-19 Thread Mike Constabel
This is logical for me. Thank you for the explanation. I read the book often, especially the ajax part. I found this sentence: It is good practice to always digitally sign Ajax callbacks. Now I ask me: Is it possible to sign the url and exclude keyword and stype? So that a user can't submit

[web2py] bug in dal.py _select geoexpand: convert geography as well

2014-03-19 Thread sunny
geoexpand should expand geography as well. otherwise geography fields will not be converted to text. the fix for me was to change the if part in geoexpand (dal.py:1713) -if isinstance(field.type,str) and field.type.startswith('geometry') and isinstance(field, Field): +

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread Derek
I'd say the answer to 2 is 'not really'. Believe it or not, opening and dropping database connections is a fast operation. On Tuesday, March 18, 2014 11:33:04 PM UTC-7, tec...@gmail.com wrote: Dear Sirs, I understand it's possible to use databases without DAL. For example function in

Re: [web2py] 504 Gateway Time-out

2014-03-19 Thread António Ramos
2014-03-19 12:24 GMT+00:00 Johann Spies johann.sp...@gmail.com: uwsgi_read_timeout sorry my ignorance , where do i do that? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] pytds support for mssql?

2014-03-19 Thread Derek
Back in November, niphlod (?sp) said that he'd look into adding pytds support to DAL. I didn't have a chance to look a lot at pytds until recently, I don't see that it's supported yet. I believe the only thing missing from pytds to be able to add support is the DSN connection syntax. If anyone

Re: [web2py] Pulling data every 30s for a ticker with web2py

2014-03-19 Thread Derek
What do you mean it's a lot of load? Is the UI freezing while it's loading, or is something else happening? On Wednesday, March 19, 2014 7:28:51 AM UTC-7, Martin wrote: Le lundi 17 mars 2014 14:21:27 UTC+2, Ramos a écrit : does this help? http://vimeo.com/27478796 2014-03-16 17:48

[web2py] Re: Pulling data every 30s for a ticker with web2py

2014-03-19 Thread Derek
If you are pulling data from another web service, take a look at the cache function built into web2py. Use that to get the api results and it will cache the results. Any time the results are requested, if they are older than the expiration time, they will force a reload. The only issue with

Re: [web2py] Python Performance Issue, Part 2

2014-03-19 Thread Tim Richardson
Try threads = 30 or 50 or 100; that would be interesting. -- 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