[web2py] Re: Are there any efficient security recommendations for file downloads?

2015-09-28 Thread Niphlod
use digitally signed URLs On Tuesday, September 29, 2015 at 2:28:43 AM UTC+2, Phillip wrote: > > Presently, files are being downloaded simply by concatenating a string of > all file id's to a "{{=URL('download_files')}}" call. > > > To be efficient, I want to avoid having to authorize each ID as

[web2py] Re: LOAD and export to CSV

2015-09-28 Thread 'DenesL' via web2py-users
Yes, the content is properly set but it is returned as the component content instead of a separate file, which is what should happen IMHO. What I need is some way to "cancel" the LOAD so the file is returned instead and the component is not updated, because otherwise it would become empty. So

[web2py] Proposed Change to "setup-web2py-fedora.sh"

2015-09-28 Thread Michael M
On File "Setup-web2py-fedora.sh" Line 387: sudo -u apache python -c "from gluon.main import save_password; save_password(raw_input('admin password: '),443)" to Line 387: sudo -u apache python -c "from gluon.main import save_password; import getpass; save_password(getpass.getpass('admin password:

[web2py] LOAD and export to CSV

2015-09-28 Thread Brian M
Have you tried setting the appropriate content type header before returning? I've not done it inside a LOAD before but know that setting the content type will normally get the browser to download & save a CSV file rather than just display it. Brian -- Resources: - http://web2py.com - http://w

[web2py] Are there any efficient security recommendations for file downloads?

2015-09-28 Thread Phillip
Presently, files are being downloaded simply by concatenating a string of all file id's to a "{{=URL('download_files')}}" call. To be efficient, I want to avoid having to authorize each ID as belonging to the user (since there could be a manual download call with arbitrary IDs) Is there a

[web2py] Re: template variable issue

2015-09-28 Thread Leonel Câmara
This version of yours should work def browser_email(): context = dict( verification_url_on_site_enabled=False, illustration_image_enabled=False, main_title_enabled=False ) return response.render('templates/email_verification.html', context) Yes put it in

Re: [Bulk] [web2py] Re: template variable issue

2015-09-28 Thread 'Diogene Laerce' via web2py-users
Le 28/09/2015 20:53, Leonel Câmara a écrit : > I think you are calling browser_email() from another controller > function like if it was a regular python function, browser_email then > changes the view the calling controller will use which then causes the > problem you are seeing. > > You need to

Re: [web2py] How to build the book...

2015-09-28 Thread Dave S
On Monday, September 28, 2015 at 1:28:10 AM UTC-7, Manuele wrote: > > Il 23/09/15 22:45, Manor Askenazi ha scritto: > > Hello there, > > > > I am trying to learn web2py and would like to start directly with the > > latest version. > > However, the pdf on the main website is for the 5th editi

[web2py] Re: Configurar um projeto web2py para se conectar ao postgres

2015-09-28 Thread Dave S
On Monday, September 28, 2015 at 11:40:48 AM UTC-7, Dave S wrote: > > > I think book examples are at > > but I can't drill down there while the hosting service's load balancer is > out of sorts > (PythonAnywhere, Error code: 504-loadbalancer) > and my hardcopy is at home. > > Site back to norm

[web2py] Re: How to download (zip) file with jQuery ajax?

2015-09-28 Thread Niphlod
whoops sorry. as son as I finished posting I realized that technically a download can't be triggered by an ajax request. You have to either set the window.location or rely on the - at the moment flaky - download spec for html5. I'd go for window.location. > >>> -- Resources: - http://web2py.c

[web2py] Re: How to download (zip) file with jQuery ajax?

2015-09-28 Thread Niphlod
what if you don't call it via ajax ? On Monday, September 28, 2015 at 8:46:01 PM UTC+2, Phillip wrote: > > Yes, on the surface it appears to work perfectly for me as well, as did > the function I posted. Hence, it appears that something is wrong with > either the ajax call, or some nuance that a

[web2py] Re: template variable issue

2015-09-28 Thread Leonel Câmara
I think you are calling browser_email() from another controller function like if it was a regular python function, browser_email then changes the view the calling controller will use which then causes the problem you are seeing. You need to use response.render to create your email in browser_em

[web2py] Re: Configurar um projeto web2py para se conectar ao postgres

2015-09-28 Thread Leonel Câmara
Oi Silvius. Se quiseres a minha empresa ( http://i-am.pt ) faz-te isso. No entanto, é difícil fazer o orçamento sem ver o layout que queres ajustar ao web2py. Além disso, se estás interessado em ser tu o principal programador deste projecto, pode ser um bom exercício de aprendizagem seres també

[web2py] Re: How to download (zip) file with jQuery ajax?

2015-09-28 Thread Phillip
Yes, it appears to work perfectly for me as well, as did the function I posted. Hence, it appears that something is wrong with either the ajax call, or some nuance that a novice like myself does not see, which is probably so obvious to you that you do not see what I'm missing. My only hint is

[web2py] Re: Configurar um projeto web2py para se conectar ao postgres

2015-09-28 Thread Dave S
On Sunday, September 27, 2015 at 2:53:58 PM UTC-7, Silvius do Brasil wrote: > > Boa noite pessoal, > > Estou iniciando na linguagem python, mas já programo em java e tenho um > projeto desenvolvido em java + flex pra informatizar as redes municipais de > educação. Gostaria de migrar meu projeto

Re: [Bulk] [web2py] Re: template variable issue

2015-09-28 Thread 'Diogene Laerce' via web2py-users
Le 28/09/2015 18:24, Leonel Câmara a écrit : > My guess is that you have put this in layout.html and not all your > pages have verification_url_on_site_enabled defined. > > The easiest fix would be to make sure it's defined changing it to > something like this: > > {{verification_url_on_site_enab

[web2py] Re: hosting on hostgator

2015-09-28 Thread Dave S
On Sunday, September 27, 2015 at 2:53:55 PM UTC-7, thinh nham wrote: > > I followed the instruction from > http://www.web2pyslices.com/slice/show/1567/running-web2py-on-hostgator-shared-host. > > After I created the index.fcgi and htaccess file, how do i run web2py > applications ? I download

[web2py] Re: hosting web2py on hostgator

2015-09-28 Thread Dave S
On Sunday, September 27, 2015 at 2:53:53 PM UTC-7, thinh nham wrote: > > I followed the instruction from this link > http://www.web2pyslices.com/slice/show/1567/running-web2py-on-hostgator-shared-host > > and what should be my next steps ? I need to deploy a web application to my > site and i

[web2py] Re: DAL - join on ROW_NUMBER()

2015-09-28 Thread Dave S
On Sunday, September 27, 2015 at 2:49:33 PM UTC-7, lfestevao wrote: > > Hy there, I have a query ready and works alright with executesql. > I'm trying to change queries to use the dal but there's a problem in this > case. > What's your goal in switching from executesql() to using the dal? >

[web2py] Re: web2py

2015-09-28 Thread Dave S
On Friday, September 25, 2015 at 11:18:18 PM UTC-7, Jagadeesh wrote: > > what is request.vars,request.args and request.env > what is the use of the above things in web2py > > Stifan pointed to the complete answer, but the short answer is "what the browser tells the server so that the server

[web2py] Re: Internal error while session varaible value printing

2015-09-28 Thread Leonel Câmara
Instead of: session.a= session.a + 1 Use: session.a= (session.a or 0) + 1 As session.a will return None if a isn't there and you can't add None and 1. Also you need to understand that 127.0.0.1 is the loopback address so we can't really see the tickets you have there. -- Resources: - http://w

[web2py] Re: auth_user_registration_key in web2admin

2015-09-28 Thread Dennis Bauszus
I still haven't been able to make the myapplication/appadmin interface accessible without logging in to the web2py admin. :( -- 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] Re: template variable issue

2015-09-28 Thread Leonel Câmara
My guess is that you have put this in layout.html and not all your pages have verification_url_on_site_enabled defined. The easiest fix would be to make sure it's defined changing it to something like this: {{verification_url_on_site_enabled = globals().get('verification_url_on_site_enabled',

Re: [Bulk] [web2py] Re: template variable issue

2015-09-28 Thread 'Diogene Laerce' via web2py-users
Le 28/09/2015 15:13, Leonel Câmara a écrit : > Not without seeing more code, my guess is that there's some kind of > redirect so the view ends up being called without the proper variables. Here's the faulty piece of view code : {{if verification_url_on_site_enabled:}} {{block verification_url_on

[web2py] Re: Grails for web2py - anyone interested ?

2015-09-28 Thread Graham Ranson
Thanks for the responses. I suspect that in the short term it would be simplest to put the code etc. on web2pyslices and then it's available for anyone to look at and use. But probably in the longer term it belongs on somewhere like Github. It does appear to work at the moment although I am sti

[web2py] Dynamic Query SQLFOR.GRID

2015-09-28 Thread Laurent Lc
function in controller def showselectionfunding(): groupe = request.vars['groupe'] ask_date = request.vars['ask_date'] query=((db1.test.groupe == groupe)&(db1.test.datefincontrat > ask_date)) #query=((db1.test.groupe == groupe)&(db1.test.financement== financement)&(db1.test.datefi

[web2py] Re: if form accepts, add variable to session throws 504 error

2015-09-28 Thread Anthony
Assuming session.mycli is a list, then it should be session.mycli.append(form.vars.id). The .extend method takes an iterable (e.g., another list). Anthony On Monday, September 28, 2015 at 8:35:13 AM UTC-4, Mark Billion wrote: > > 504 Error: > if form.accepts(request,session): > sess

[web2py] Re: template variable issue

2015-09-28 Thread Leonel Câmara
Not without seeing more code, my guess is that there's some kind of redirect so the view ends up being called without the proper variables. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

Re: [web2py] if form accepts, add variable to session throws 504 error

2015-09-28 Thread Vinicius Assef
I suppose your `session.mycli` doesn’t support the `extend()` method. What the ticket generated by this error says? — Vinicius. > On 28 Sep 2015, at 09:35, Mark Billion wrote: > > 504 Error: > if form.accepts(request,session): > session.mycli.extend(form.vars.id) > redir

[web2py] if form accepts, add variable to session throws 504 error

2015-09-28 Thread Mark Billion
504 Error: if form.accepts(request,session): session.mycli.extend(form.vars.id) redirect(URL('client_edit', vars={'cli':form.vars.id})) No Error: if form.accepts(request,session): #session.mycli.extend(form.vars.id) redirect(URL('client_edit', vars={'cli':fo

[web2py] template variable issue

2015-09-28 Thread 'Diogene Laerce' via web2py-users
Hi, I have this code : def browser_email(): response.view = 'templates/email_verification.html' return dict( verification_url_on_site_enabled=False, illustration_image_enabled=False, main_title_enabled=False ) which works if I call

[web2py] Re: LIVE CONFERENCE

2015-09-28 Thread Leonel Câmara
If you can restrict yourself to only chrome and firefox I think the easiest way would be to use webrtc (Microsoft is working on an implementation so it will eventually work there too): http://www.html5rocks.com/en/tutorials/webrtc/basics/ Otherwise I suggest you integrate a service who already

[web2py] Error: widgetId is a required parameter (2.12.2)

2015-09-28 Thread Dennis Bauszus
Web2py version 2.12.2. The admin site is throwing* Error: widgetId is a required parameter* from the widget.js library. This is caused by the twitter-timeline link tag being inside a twitter-timeline container element. This confuses the widget extraction code as noted in this post

Re: [web2py] How to build the book...

2015-09-28 Thread Manuele Pesenti
Il 23/09/15 22:45, Manor Askenazi ha scritto: > Hello there, > > I am trying to learn web2py and would like to start directly with the > latest version. > However, the pdf on the main website is for the 5th edition. I would > like to build the 6th... > What's the proper procedure? > > Manor. Consi

Re: [web2py] Re: session less connections

2015-09-28 Thread Itamar Cohen
I found this line close to the top of my default.py session.flash=response.flash Could be it ? Best Regards Itamar Cohen Picatek Ahornvej 27 DK-7700 Thisted Denmark www.picatek.dk i...@picatek.dk T: +45 97 91 07 82 M:+45 29 89 07 82 On 28 September 2015 at 01:29, Anthony wrote: > No, that code