[web2py] Custom library function

2014-05-08 Thread Gael Princivalle
Hello all. Is there a way to have a custom library file where I can put some custom functions ? For example in default.py: def index(): a = 4 b = my_custom_function(a) return dict(b = b) And in my library file: def my_custom_function(my_var): var = my_var + 3 return var

Re: [web2py] Re: Does Web2py Postgres Adapter support JSON as native type ?

2014-05-08 Thread Mandar Vaze / मंदार वझे
Niphlod, Thanks for your answer. Just to clarify that I have understood I need not worry, Web2py DAL code will pick the right/correct adapter for me, and will support native JSON Cool !! -Mandar On Mon, May 5, 2014 at 12:24 AM, Niphlod niph...@gmail.com wrote: the postgres2 adapter is a

Re: [web2py] Re: SQLFORM.grid search with custom request.vars

2014-05-08 Thread Paolo Valleri
I opened an issue https://code.google.com/p/web2py/issues/detail?id=1931 On Wednesday, May 7, 2014 3:24:38 PM UTC+2, Anthony wrote: On Wednesday, May 7, 2014 4:00:33 AM UTC-4, Paolo Valleri wrote: The workaround of the hidden fields seems to be much more complex for this simple issue,

[web2py] How would you design a recipe app?

2014-05-08 Thread csavorgn
Hi everyone, I would like to write an app to organize recipes. Besides creating/updating the recipes, I will add functionalities based on the ingredients the recipes use. Therefore, I thought of creating a table which will store the recipes and another for the ingredients. Every recipe will have

Re: [web2py] web2py conference - online talks

2014-05-08 Thread António Ramos
The angular talk was very informative. +1 to Angular and web2py 2014-05-06 4:09 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com: I do not think so. On Monday, 5 May 2014 10:38:17 UTC-5, marco mansilla wrote: Is there any chance to download this videos to watch offline?, that

[web2py] Re: Uforum - a forum web2py application

2014-05-08 Thread Stefaan Himpe
I have created a web2py forum software, now currently only in the Dutch but wil be ported to english. Ziet er goed uit! -- http://technogems.blogspot.com http://a-touch-of-music.blogspot.com http://youtube.com/stefaanhimpe -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Here's how to run Web2Py on IBM BlueMix

2014-05-08 Thread Massimo Di Pierro
Thank you Duncan, this is very valuable. There should be a setup script for this shipping with web2py. Is there any IBM blog wjere we could advertise it? Massimo On Tuesday, 6 May 2014 19:29:48 UTC-5, duncan macneil wrote: Hi all, I've been trying out the www.bluemix.net IBM PaaS. It

[web2py] Re: Here's how to run Web2Py on IBM BlueMix

2014-05-08 Thread Willoughby
Is Azure in your shoot-out? I'd be interested in hearing those results... On Wednesday, May 7, 2014 9:07:34 PM UTC-4, duncan macneil wrote: I don't wanna be one of those guys who just compares on price alone but I will obviously be comparing price to other options. (By which I mean

Re: [web2py] Re: Does Web2py Postgres Adapter support JSON as native type ?

2014-05-08 Thread Niphlod
yep, that's right. On Thursday, May 8, 2014 9:05:44 AM UTC+2, Mandar Vaze wrote: Niphlod, Thanks for your answer. Just to clarify that I have understood I need not worry, Web2py DAL code will pick the right/correct adapter for me, and will support native JSON Cool !! -Mandar On Mon,

[web2py] Re: How would you design a recipe app?

2014-05-08 Thread 黄祥
please take a look at cookbook web2py appliances. ref: http://www.web2py.com/appliances best regards, stifan -- 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)

Re: [web2py] Re: Does Web2py Postgres Adapter support JSON as native type ?

2014-05-08 Thread Anthony
And here's where it happens in the code: https://github.com/web2py/web2py/blob/master/gluon/dal.py#L2886 Anthony On Thursday, May 8, 2014 3:05:44 AM UTC-4, Mandar Vaze wrote: Niphlod, Thanks for your answer. Just to clarify that I have understood I need not worry, Web2py DAL code will

[web2py] Re: Custom library function

2014-05-08 Thread mcamel
It sounds you are looking for a module. You can place 'mylibrary.py' at the module folder of your app, and import its functions onto controllers or models, like: from mylibrary import my_custom_function You can add this to a model file to get changes at your modules without restarting web2py:

[web2py] Reload page on component form submit

2014-05-08 Thread Carlos Cesar Caballero Díaz
I need to reload a page when a component form is submitted, the book says that |ajax_trap=False| indicates that forms must be submitted normally, thus reloading the entire page. Using |ajax_trap=False |the page is reloaded, but the form action is not executed (there is no new entry in the db

[web2py] Re: Reload page on component form submit

2014-05-08 Thread Anthony
You should not set ajax_trap=False, as that will cause the form to be submitted to the action of the parent page rather than the action of the component. Instead, in your form processing code, if the form is accepted, you can do a redirect to the parent page URL, which will cause that URL to

[web2py] Re: How would you design a recipe app?

2014-05-08 Thread csavorgn
Thanks Stifan, but in the link you sent I couldn't find the implementation of the the cookbook Carlo On Thursday, May 8, 2014 2:51:47 PM UTC+2, 黄祥 wrote: please take a look at cookbook web2py appliances. ref: http://www.web2py.com/appliances best regards, stifan -- Resources: -

[web2py] X509 Documentation is wrong

2014-05-08 Thread LoveWeb2py
Book says: from gluon.contrib.login_methods.x509_auth import X509Account auth.settings.actions_disabled=['register','change_password','request_reset_password'] auth.settings.login_form = X509Account()

[web2py] Re: apply static html/graphic to layout template

2014-05-08 Thread Andrey K
Thanks a lot for your feedback and suggestions! It support my vague vision:) Now I am certain on the way to go about it. Thanks again! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: Web2Py Pages module (basic CMS)

2014-05-08 Thread Rene Dohmen
Hi Again, Just updated the web2py-pages master branch with 2 .w2p files. And started a new branch (develop) which contains a complete welcome app with the page plugin already working that can be used as an appliance to speed up testing and developing with it.

Re: [web2py] Re: Reload page on component form submit

2014-05-08 Thread Carlos Cesar Caballero Díaz
Anthony, thanks for your answer. Of course, the form is submitted to the parent page... I think that I should rest a litle and continue tomorrow... Thanks again for your answer El 08/05/14 10:10, Anthony escribió: You should not set ajax_trap=False, as that will cause the form to be

Re: [web2py] Re: Uforum - a forum web2py application

2014-05-08 Thread Rene Dohmen
+1 2014-05-08 12:26 GMT+02:00 Stefaan Himpe stefaan.hi...@gmail.com: I have created a web2py forum software, now currently only in the Dutch but wil be ported to english. Ziet er goed uit! -- http://technogems.blogspot.com http://a-touch-of-music.blogspot.com

[web2py] Re: How would you design a recipe app?

2014-05-08 Thread Willoughby
https://github.com/mdipierro/web2py-appliances/tree/master/CookbookExample On Thursday, May 8, 2014 10:48:39 AM UTC-4, csavorgn wrote: Thanks Stifan, but in the link you sent I couldn't find the implementation of the the cookbook Carlo On Thursday, May 8, 2014 2:51:47 PM UTC+2, 黄祥

[web2py] Mozilla Web App Security recommendations

2014-05-08 Thread Joe Barnhart
Anyone see this? https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines From my quick reading, web2py does pretty well according to the recommendations here... -- Joe -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: Mozilla Web App Security recommendations

2014-05-08 Thread Massimo Di Pierro
Once we were audited for security. Yet the page with results is gone and all that I could find is this blog post: http://pythonsecurity.tumblr.com/post/807089821/web2py-a-framework-that-cares-about-security On Thursday, 8 May 2014 14:14:27 UTC-5, Joe Barnhart wrote: Anyone see this?

[web2py] is it allowed/possible to replace the database within a controler ?

2014-05-08 Thread Stef Mientki
hello, I've a web2py site, which should run, more or less synchronized, (with the same data) on 2 different servers. The first one is filling the database. The second one should copy the db from the first one if the database was refreshed more than 24 hours ago. So the solution I've in

[web2py] Re: Mozilla Web App Security recommendations

2014-05-08 Thread Joe Barnhart
Sadly the links in the article no longer point to any information about web2py. Looks like the python security project got rid of its wiki and all of the information it had (like web2py's score) is now lost. -- Joe On Thursday, May 8, 2014 1:25:11 PM UTC-7, Massimo Di Pierro wrote: Once we

[web2py] Re: is it allowed/possible to replace the database within a controler ?

2014-05-08 Thread Anthony
You probably don't want a web request to potentially have to wait for a database copy over the network before returning a result. It would probably make more sense to set up a scheduled task to replicate the database once a day. Or better yet, look into the replication options offered by your

[web2py] Do we need a response.files for footer as well as header?

2014-05-08 Thread Joe Barnhart
Some folks recommend javascript files be placed at the end of the page to facilitate fast loading. We have the response.files idiom that makes it easy to compress and serve the static files, but it with response.include_files() to append the files to the header. It can't serve both header and

[web2py] Re: Do we need a response.files for footer as well as header?

2014-05-08 Thread Anthony
I suppose you could edit web2py_ajax.html to include only CSS files, and then do {{=response.include_files(extenstions=['js'])}} at the bottom of the layout. Anthony On Thursday, May 8, 2014 6:46:13 PM UTC-4, Joe Barnhart wrote: Some folks recommend javascript files be placed at the end of

Re: [web2py] Re: Reload page on component form submit

2014-05-08 Thread LaDarrius Stewart
---controller-- @auth.requires_login() def test(): a=request.args(0) form=SQLFORM(db.Notes).process() form.vars.TestID = a comments=db(db.Test.TestID==a).select() if form.process(formname=somename).accepted: form.vars.TestID = a