[web2py] web2py website error with Chinese user

2014-10-23 Thread Gael Princivalle
Hello all. I've got a Chinese user that complains he cannot login in a web2py website that I've done. He send me a printscreen where all CSS and Javascript are not loaded, so he can't login. If he use a VPN it's ok. Someone know why ? Perhaps it's due to Chinese network restrictions ? Thanks.

[web2py] limit on username length without defining db.auth_user ?

2014-10-23 Thread LoveWeb2py
Hello -- simple question. Is it possible to set a username length with db.auth_user.username.requires = length 20 Something to that effect? By default users can create as long of a username as they want and I'd like to make it a little more secure. The book mentions redefining the auth.user

[web2py] Re: Access DAL from outside script

2014-10-23 Thread Richard
Solved :) Mistake was the missing closing \\ in the database folder. The working version is module_path = os.path.abspath(os.path.dirname('C:\\web2py\\applications\\wemanops_test\\databases\\')) Thank you On Wednesday, October 22, 2014 4:58:59 PM UTC+2, Richard wrote: Hi, I want to access

Re: [web2py] Re: We could have something like this

2014-10-23 Thread António Ramos
are you refering to web2pyslices ? *But the main difference I see is the dated layout, design and UX.* *It is a nice tool but already needs a refresh.* If yes i agree with you. 2014-10-21 20:41 GMT+01:00 Carlos Costa yamandu.co...@gmail.com: It does not the same thing but it does. It was

[web2py] language and localization development

2014-10-23 Thread Manuele Pesenti
Hi, maybe I'm wrong but it seams that during development I have to write messages in english using the translator and than write the corresponding translation in language file I intend to use. Is these a way of using another language during development maybe identifying it every times I use T e.g.

Re: [web2py] Re: db.commit() taking too long to update records

2014-10-23 Thread Luciano Laporta Podazza
Hi Anthony!, Indeed, the ajax call was the issue, after reading this: http://web2py.com/books/default/chapter/29/04#session I realised that storing sessions in database solved my problem(there's no more blocking calls issue). Thanks a lot for your help Cheers. On Thu, Oct 23, 2014 at 1:01

[web2py] Re: language and localization development

2014-10-23 Thread Paolo Valleri
Hi, try T.set_current_languages('it') see http://web2py.com/books/default/chapter/29/04/the-core#Determining-the-language Paolo On Thursday, October 23, 2014 1:47:11 PM UTC+2, Manuele wrote: Hi, maybe I'm wrong but it seams that during development I have to write messages in english

[web2py] Re: language and localization development

2014-10-23 Thread Leonel Câmara
You can do what Paolo suggested, it will work. I'd like to make a suggestion though - Don't do this. For me, everything that's in the code should be in English, variable names, strings like this one, comments, every single thing. For many reasons, it looks better, you don't tire your brain

Re: [web2py] Re: db.commit() taking too long to update records

2014-10-23 Thread Anthony
Keep in mind that the benefit of locking the session is that you avoid race conditions, so you now have to make sure there is no possibility of a race condition with the session if you have multiple calls happening asynchronously. The other option is to continue using file base sessions, but

[web2py] SQLFORM. Insert field to DB from calculation (not from form)

2014-10-23 Thread Dmitry Vlasov
Hi folks, I'm trying to insert additional field to DB, but it cannot be obtain from SQLFORM. I use SOLIDGRID plugin http://dev.s-cubism.com/plugin_solidgrid?_signature=868375a5ca48f87805d4366b05a2df678637611e For my purposes I define a table db.define_table('r_users',

[web2py] reference auth_user from a table in one database to the auth_user table in another database

2014-10-23 Thread Carl Petersen
Hello, I'm trying to reference the auth_user table in one database from a field definition for a table in a different database. Hopefully the code below will clarify: db1 = DAL('postgres://user:password@host1/database1',pool_size=1,check_reserved=None,migrate=False) db =

[web2py] Re: How can I prevent a user from pressing the browser's back button?

2014-10-23 Thread Fotis Gioulekas
Thank you very much for the feedback. I will check and let you know about the results. best regards, F On Friday, October 17, 2014 9:49:31 PM UTC+3, Dave S wrote: On Thursday, October 16, 2014 12:15:26 AM UTC-7, Fotis Gioulekas wrote: Hello, do you how is this possible to be performed? The

[web2py] Re: SAML2 Service Provider app in web2py?

2014-10-23 Thread Massimo Di Pierro
Yes it works for me. Can you help debug? Can you print d['response'] and try figure out where the response attributes are? On Friday, 17 October 2014 00:42:29 UTC-5, Prasad Muley wrote: Hi Wel, Did you test SAML2 app? there is an experimental saml2 app in web2py_2.9.6 I need to

[web2py] Re: plugin_jstree - ImportError: No module named globals

2014-10-23 Thread Massimo Di Pierro
can you try replace from globals import Response, Storage with from gluon.globals import Response, Storage On Tuesday, 21 October 2014 08:20:11 UTC-5, Alen Cerovic wrote: I am getting error with plugin_jstree on windows: Traceback (most recent call last): File gluon/restricted.py, line

[web2py] Re: reference auth_user from a table in one database to the auth_user table in another database

2014-10-23 Thread Niphlod
you can't reference fields from different databases. On Thursday, October 23, 2014 3:07:50 PM UTC+2, Carl Petersen wrote: Hello, I'm trying to reference the auth_user table in one database from a field definition for a table in a different database. Hopefully the code below will

[web2py] Re: web2py website error with Chinese user

2014-10-23 Thread Niphlod
who knows. Are you serving all assets from the same location as the site or not ? On Thursday, October 23, 2014 8:15:22 AM UTC+2, Gael Princivalle wrote: Hello all. I've got a Chinese user that complains he cannot login in a web2py website that I've done. He send me a printscreen where

[web2py] Re: RESTful request args/vars with JSON array

2014-10-23 Thread Niphlod
if the content-type of the POST request is application/json, mylist would actually be yet parsed into request.post_vars (i.e. you can skip body.read()) On Thursday, October 23, 2014 1:24:09 AM UTC+2, Henry Nguyen wrote: For posterity's sake, I was able to retrieve the array in the request

[web2py] Re: EMAIL | IMAP + SMTP | Compose Email = Save as Draft + Send via SMTP

2014-10-23 Thread Massimo Di Pierro
This should help: def index(): form = FORM(INPUT(_type='file', _id=files, _name=files, _multiple=True, _value='File test'), INPUT(_type=submit)).process() if form.accepted: for item in form.vars.files: print item.filename, item.file.read() return

[web2py] Removing password_two comment

2014-10-23 Thread Ruud Schroen
Hi guys, I'm using a auth_register() form. Right now, the password_two field (the one that requires you to re-enter your password) shows a comment next to it saying you need to re-enter your password or something. Now I want to remove that comment using the following:

[web2py] Re: SSL configuration with built-in server

2014-10-23 Thread Massimo Di Pierro
1) web2py.py -L options.py will read the configuration from a options.py file. An example is in examples/options_std.py 2) Yes. All pages will require https. On Wednesday, 22 October 2014 11:18:12 UTC-5, John Lofgren wrote: Hi, all, I would like to configure web2py to use SSL with

[web2py] Re: Removing password_two comment

2014-10-23 Thread Ruud Schroen
Found the solution. *form.custom.comment.password_two = None* -- 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

[web2py] Re: Correction for setup-web2py-heroku.sh script

2014-10-23 Thread Massimo Di Pierro
It is a matter of preference but I think you are right. Your approach is best. On Wednesday, 22 October 2014 14:31:09 UTC-5, Jay Martin wrote: Currently the setup-web2py-heroku.sh script includes these commands: sudo pip install virtualenv sudo pip install psycopg2 virtualenv venv

[web2py] Re: working directory and runtime directory when running web2py

2014-10-23 Thread Massimo Di Pierro
Thank you David and Niphlod. On Wednesday, 22 October 2014 15:52:55 UTC-5, Niphlod wrote: nice catch. https://github.com/web2py/web2py/pull/535 On Wednesday, October 22, 2014 10:48:40 PM UTC+2, David Ripplinger wrote: Yep, it works. Good job. On Wednesday, October 22, 2014 4:41:31 PM

[web2py] Re: limit on username length without defining db.auth_user ?

2014-10-23 Thread Massimo Di Pierro
db.auth_user.username.requires = IS_LENGTH(20) you can specify a min length and max length. On Thursday, 23 October 2014 01:43:34 UTC-5, LoveWeb2py wrote: Hello -- simple question. Is it possible to set a username length with db.auth_user.username.requires = length 20 Something to that

[web2py] Re: SSL configuration with built-in server

2014-10-23 Thread Niphlod
On Thursday, October 23, 2014 4:20:02 PM UTC+2, Massimo Di Pierro wrote: 1) web2py.py -L options.py will read the configuration from a options.py file. An example is in examples/options_std.py 2) Yes. All pages will require https. uhm, not really. Depends on the options passed,

[web2py] Re: Slower task scheduler performance

2014-10-23 Thread Niphlod
if you have a function that launches an external process and it takes 2.55 seconds, it will take the same when launched via the scheduler. The scheduler adds up the time it takes to create the web2py env (usually far less than half a second) in which the function is executed, but your external

[web2py] Re: web2py scheduler error when I start the worker...

2014-10-23 Thread Niphlod
did you recently upgrade to 2.9.11 without letting scheduler recreating the tables ? tables definitions have changed, and you need to let web2py adjust (i.e. look for migrate_enabled=False in your DAL call) On Tuesday, October 21, 2014 10:03:39 PM UTC+2, José Leite wrote: Hello, I just

Re: [web2py] Re: web2py website error with Chinese user

2014-10-23 Thread Gael Princivalle
Yes, everything's is in the same server. That's quite complicated to understand what's going wrong as I don't have a Chinese computer [?] for testing. -- Gael Princivalle 2014-10-23 16:12 GMT+02:00 Niphlod niph...@gmail.com: who knows. Are you serving all assets from the

[web2py] Re: db.commit() taking too long to update records

2014-10-23 Thread Leonel Câmara
Doesn't the database take care of that? I mean isn't db session handling inside a transaction anyway? -- 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) ---

[web2py] Re: web2py website error with Chinese user

2014-10-23 Thread Leonel Câmara
Are the files being loaded? If the user opens up a console does he get an error? -- 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

[web2py] Re: db.commit() taking too long to update records

2014-10-23 Thread Anthony
On Thursday, October 23, 2014 12:52:33 PM UTC-4, Leonel Câmara wrote: Doesn't the database take care of that? I mean isn't db session handling inside a transaction anyway? Yes, but that doesn't help across requests (e.g., request A reads session request B reads session request A updates

Re: [web2py] Re: Opening PDF files in web browser

2014-10-23 Thread José Eloy Torres Monreal
Sorry for my delay in answer. I've taken back the project. The solution of Leonel works well if I want to show an pdf from another website, but when I try to download a file loaded in my own web site (Web2py's upload/download method) I get the message that the file is not found. I show you the

[web2py] Re: Opening PDF files in web browser

2014-10-23 Thread José Eloy
Sorry for my delay in answer. I've taken back the project. The solution of Leonel works well if I want to show an pdf from another website, but when I try to download a file loaded in my own web site (Web2py's upload/download method) I get the message that the file is not found. I show you

Re: [web2py] Re: web2py website error with Chinese user

2014-10-23 Thread Niphlod
if you're serving all assets from the same hostname, then Chinese network restrictions aren't the cause. Maybe a wrongly set proxy, but it's entirely not web2py's fault, nor your app's code. On Thursday, October 23, 2014 5:11:57 PM UTC+2, Gael Princivalle wrote: Yes, everything's is in the

Re: [web2py] Re: language and localization development

2014-10-23 Thread Manuele Pesenti
Il 23/10/14 14:41, Leonel Câmara ha scritto: I'd like to make a suggestion though - Don't do this. I don't think I'll do it. I don't want to globally change my approach writing all text messages in other language than english. I agree your suggestion. I was just looking for a local workaround for

[web2py] Re: Opening PDF files in web browser

2014-10-23 Thread José Eloy
Hello. I've discovered if I use return response.download(request, db, attachment=False) in the else statement of the download function of my code, I can do the web browser can open the pdf file, but I miss the original filename. How I can to recover it? Regards. -- Resources: -

[web2py] Re: RESTful request args/vars with JSON array

2014-10-23 Thread Henry Nguyen
Niphlod, That does not appear to be the case, either for request.restful() requests or regular controller requests. For example, consider this controller method: def test(): logger.debug(request.env.content_type) logger.debug(request.post_vars) logger.debug(request.body.read())

[web2py] best way to play sound one time? session or cookies

2014-10-23 Thread LoveWeb2py
Hello, I would like to greet or user with a sound one time upon accessing a controller but if they click it again i would want the sound to play again while they're logged in. However if they log out and log back in I would like it to play again. What type of logic should I use sessions or

[web2py] best way to play sound one time? session or cookies

2014-10-23 Thread LoveWeb2py
I meant i wouldn't want it to play again while logged in -- 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

[web2py] Re: best way to play sound one time? session or cookies

2014-10-23 Thread Massimo Di Pierro
I would do this all in JS. You play the file then store in a html5 local storage a flag that says you played it. Next time you check the localstorage. No reason to bother the server with this information. http://www.w3schools.com/html/html5_webstorage.asp On Thursday, 23 October 2014 20:18:38