[web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Gael Princivalle
Thank you Leonel but u.image_user16x16 contains always the file name, so the test will return always True. The problem is that the image file is not created on the disk so I have to test if it exist. At this point it's not so easy to do. The application call for these computed images from the au

[web2py] Re: How to permanently load a module into web2py ?

2017-02-18 Thread Leonel Câmara
They are not imported again just because the import is there. Python and web2py's import is smart enough not to re-import a module that was already loaded unless you are using track_changes. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/we

[web2py] Re: How to permanently load a module into web2py ?

2017-02-18 Thread Anthony
It is OK to run an import statement on every request -- the Python interpreter will only import the module on the first request (per process) -- after that, it will remain in memory. Anthony On Saturday, February 18, 2017 at 3:45:05 PM UTC-5, Khalil Khamlichi wrote: > > Hello everyone, > I nee

[web2py] Re: How to permanently load a module into web2py ?

2017-02-18 Thread 黄祥
perhaps you can import it on models because models is executed for every requests 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) --- Y

[web2py] Multiple files upload

2017-02-18 Thread Creator
Hello everyone! I wanna share a situation to which I can't figure a proper solution to see if I get any ideas. Sorry if this specific topic has already been covered, but I couldn't find it anywhere. I'm trying to upload multiple files only to make some processing and return the results. At firs

[web2py] How to permanently load a module into web2py ?

2017-02-18 Thread Khalil Khamlichi
Hello everyone, I need to query redis a lot, do I have to import redis on each request ? also I am sedning websocket messages, do I need to import websocket library on every request ? isn"t there any way to load them permanently into web2py ? Thanks in advance. -- Resources: - http://web2py.

[web2py] Re: javascript prompt and modal dialog

2017-02-18 Thread Andrea Fae'
I will be very grateful who can answer. thanks a lot!! Il giorno sabato 18 febbraio 2017 20:11:30 UTC+1, Andrea Fae' ha scritto: > > Hello. > From Javascript I need to ask some different values and promt is good only > for 1 text box. > > I know that I have to use jqury modal dialog, but I don't

[web2py] Re: Call functions from other applications without network requests

2017-02-18 Thread Anthony
> If I understand right, the second one generates an HTTP request. That > means the data that is fetched will be serialized and deserialized. In > some cases this data is sizable, so I want to avoid that overhead. There > will likely also be some overhead associated with actually > sending

[web2py] Re: web2py & react

2017-02-18 Thread Marlysson Silva
Great! Em quinta-feira, 16 de fevereiro de 2017 15:05:38 UTC-3, José L. escreveu: > > Inspired by > https://medium.com/react-redux/introducci%C3%B3n-a-redux-js-8bdf4fe0751e#.iqodqn8cc > I have created a small project, using web2py instead of Django: > https://github.com/jredrejo/web2pyreactpoc >

[web2py] Re: Call functions from other applications without network requests

2017-02-18 Thread Brendan Barnwell
On Saturday, February 18, 2017 at 6:00:23 AM UTC-8, Anthony wrote: > > Do you have a use case that cannot easily be accommodated by that pattern? >> If so, what do you imagine would be the API for doing what you want to do, >> and would it look much different from simply making an HTTP call (or

[web2py] javascript prompt and modal dialog

2017-02-18 Thread Andrea Fae'
Hello. >From Javascript I need to ask some different values and promt is good only for 1 text box. I know that I have to use jqury modal dialog, but I don't know nothing about it (I need to study?) Is there anyone that can write me a very simple example? You have to know that I have to use wit

[web2py] Re: Validation error, field:email while trying to conect to SQL Express

2017-02-18 Thread Leonel Câmara
The error is not in the connection string or with the migrate settings. I would try this in the command line to see what the problem is: cd web2pydirectoryhere python web2py.py -S nameofyourapplication -M IS_NOT_IN_DB(db, 'auth_user.email')('em...@youknowisnotthere.com') If everything is workin

[web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Leonel Câmara
Gael that's one of the bugs i've referred fo computed fields they are not updated in session. Notice that you use *auth.user*.image_user16x16 Well auth.user is nothing other than *session*.auth.user You are also using os.path.exists wrong as you're giving it an URL. For instance I'm sure this

Re: [web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Nico de Groot
Revision: URL() produces a relative link, but the os.path. functions look at the filesystem from the folder web2py is running from. You should construct the path using os.path.join and request.folder see http://stackoverflow.com/questions/6439252/returning-a-file-in-uploads-directory-with-web2py

[web2py] Re: Agree on some terms before registration

2017-02-18 Thread Gael Princivalle
Hello. Here is a complete solution without the use of a custom form. auth.settings.extra_fields['auth_user']= [ Field('agree_terms_and_conditions','boolean', label=T('I agree to terms and conditions'),default=False,requires=IS_NOT_EMPTY(error_message=T('You must agree the term conditions'))

Re: [web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Nico de Groot
Revision: URL() produces a relative link, but the os.path. function look at the filesystem from the folder wep2py is running from. You can construct the path using os. path.join and request.folder see http://stackoverflow.com/questions/6439252/returning-a-file-in-uploads-directory-with-web2py-st

[web2py] Re: Call functions from other applications without network requests

2017-02-18 Thread Anthony
It may also be worth noting that you can get the output of another controller function within the *same *application via LOAD(..., ajax=False) (note, ajax=False is actually the default). This, however, will also execute the called function's view and return the full rendered output. In this cas

Re: [web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Nico de Groot
The images that are created would have an extention, like .jpg The URL() doesn't produce it. Please check this using debugger or print statement. Nico -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.

[web2py] Re: Call functions from other applications without network requests

2017-02-18 Thread Anthony
> > Do you have a use case that cannot easily be accommodated by that pattern? > If so, what do you imagine would be the API for doing what you want to do, > and would it look much different from simply making an HTTP call (or > possibly an RPC call) to the other app (which you can already do)?

Re: [web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Gael Princivalle
Thanks but it returns also False: if os.path.exists(URL('download', 'default', args=auth.user.image_user16x16)): Does it work if you do a similar test? -- Gael Princivalle 2017-02-18 14:27 GMT+01:00 Nico de Groot : > Use os.path.exists() to check if a file exists. Is.file() c

[web2py] Re: Call functions from other applications without network requests

2017-02-18 Thread Anthony
> If I visit /test_env/db_worker/call/json/work_service?a=1&b=2, I get the > right result. What I want is to be able to visit > /test_env/boss/order_service and get the exact same result. Right now, I > get "name 'service' is not defined" (because db.py is not run, and > "service" is define

[web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Nico de Groot
Use os.path.exists() to check if a file exists. Is.file() checks if the object is a file or a link. Nico de Groot -- 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 Is

[web2py] Re: Smarthumb computed fields not computed after register

2017-02-18 Thread Gael Princivalle
I've checked better the situation. After register computed fields are ok. For example in the image_user16x16 field I have: auth_user.image_user.928995a79b13d5d0.506f7274726169744356323031332d512e6a7067_image_user16x16.jpg Link is ok in the view: /download/default/auth_user.image_user.928995a79b1

[web2py] Re: Web2py Websocket in Rest

2017-02-18 Thread nexususer68
it depends you can use tornado web framework. but if you want to make a complete website and chatting is one of it's features then it's better to use both in order to benefit from web2py features . but either way you have to start by learning how to use tornado.websocket and then you'll be able