[web2py] strange behaviour in after_insert callback

2016-04-20 Thread 黄祥
meet strange behaviour in after_insert callback, when using variable (e.g. f.amount) is not work, but when using dict (e.g. f['amount'] ) work models/db_wizard_4_subscription.py # not work def __after_insert_subscription_detail(f, id): unit = float(f.amount) / float(f.nav_per_unit) """ # work

Re: [web2py] Re: Nginx, uwsgi, on Windows

2016-04-20 Thread Kiran Subbaraman
Narrowed down the issue. Basically, the grequests modules that I was using seems to be the cause of the "LoopExit: This operation would block forever" Create an application: *redis_event* *controller: default.py* import cache_mod def index(): return dict(message=cache_mod.get_value())

Re: [web2py] Re: Windows / 2.14.5 / Cannot import module

2016-04-20 Thread Kiran Subbaraman
Dave, thanks for this tip. I wasn't aware of this. In any case, going back to my preferred runtime - source version of web2py. Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Thu, 21-04-2016 12:46 AM, Dave S wrote: On Wednesday, April 20,

Re: [web2py] Re: Windows / 2.14.5 / Cannot import module

2016-04-20 Thread Kiran Subbaraman
Anthony, thanks for the details. Yes, my preferred runtime is the source version of web2py. Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Thu, 21-04-2016 1:04 AM, Anthony wrote: On Wednesday, April 20, 2016 at 3:01:09 PM UTC-4, Kiran

Re: [web2py] Re: Nginx, uwsgi, on Windows

2016-04-20 Thread Kiran Subbaraman
Thanks for the recommendation - IIS with web2py is a recommended deployment on Windows. The gevent-mix-up-with-rocket, was based on the stack trace I pasted below. And like I mentioned, this connection was made without any evidence ... so yeah, I was writing this before I gave it too much

[web2py] Re: How to ensure each row in the db table having distinct value of a partcular field?

2016-04-20 Thread Michael Beller
unique=True assures the value is unique at the database level but does not add a form validator. In addition to unique=True, you can add a validator like this: db.person.username.requires = IS_NOT_IN_DB(db, 'person.username') from the book:

Re: [web2py] what's the best approach for view and update forms for multiple tables?

2016-04-20 Thread Michael Beller
Thanks Richard, I should have provided more details. When I tried to create a form using SQLFORM.factory for two tables (including auth_user), I would get an error that the auth_user email and username existed even if I wasn't updating those fields. It appears that the validator to assure

[web2py] Re: relation "auth_user" already exists

2016-04-20 Thread Michael Beller
It sounds like you need to update the .tables files to match your database and models. I believe you need to set both migrate=True and fake_migrate_all=True for the fake migrate to regenerate the .tables files. Here's the logic in the book:

[web2py] Re: How can I pre populate a option column of a form?

2016-04-20 Thread Michael Beller
before you call SQLFORM, insert: db.pratiche.stato_pratica.default = 'aperta' On Wednesday, April 20, 2016 at 6:05:06 PM UTC-4, Andrea Marin wrote: > > Hi I have this type of form in my model file: > > db.define_table('pratiche', > Field('nome', requires=IS_NOT_EMPTY()), >

[web2py] Re: checkboxes framework7.io and validate

2016-04-20 Thread kenny c
Looks interesting. How is your development going with f7 and web2py? -- 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

[web2py] CodernityDB pure python nosql

2016-04-20 Thread kenny c
I would love to try this! Thanks for the link -- 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 subscribed to the

[web2py] Re: Getting web2py to reload module files for each return view

2016-04-20 Thread Alex Benfica
Hi! I'm afraid this solution does not work on App engine development environment. Is there any other way? Em sexta-feira, 24 de outubro de 2014 21:52:03 UTC-2, Massimo Di Pierro escreveu: > > Normally modules are not reloaded because they are cached by python. > web2py can bypass this,

[web2py] Re: Nginx, uwsgi, on Windows

2016-04-20 Thread Niphlod
forget about uwsgi on windows. never really landed as production-ready. fortunately iis can run python without any hiccup and it's the current recommended way to deploy web2py in production on windows. that being said, I'm really eager to know how the hell you're getting gevent mixed up with

[web2py] How can I pre populate a option column of a form?

2016-04-20 Thread Andrea Marin
Hi I have this type of form in my model file: db.define_table('pratiche', Field('nome', requires=IS_NOT_EMPTY()), Field('descrizione', 'text', requires=IS_NOT_EMPTY()), Field('tipo_allegato', requires=IS_IN_SET(['mandato', 'comparsa preliminare',

[web2py] Re: built-in wiki

2016-04-20 Thread briannd81
Can you elaborate more on both solutions? How can I get this to work when I create the image link inside the slug? On Tuesday, April 19, 2016 at 5:09:32 PM UTC-4, bria...@gmail.com wrote: > > I use the built-in wiki for my application. I created a page (slug) and > upload the image using the

Re: [web2py] relation "auth_user" already exists

2016-04-20 Thread Richard Vézina
which web2py version? On Wed, Apr 20, 2016 at 4:34 PM, Gael Princivalle wrote: > Hello. > > I'm still having some pain with DAL connection strings and migrations. > > In one application my DAL connection string is like that: >

[web2py] relation "auth_user" already exists

2016-04-20 Thread Gael Princivalle
Hello. I'm still having some pain with DAL connection strings and migrations. In one application my DAL connection string is like that: DAL('postgres://username:password@localhost:5432/postg_db', check_reserved=[ 'all'], pool_size=1, entity_quoting=True, bigint_id=True, migrate=False,

[web2py] Re: sequential requests

2016-04-20 Thread Jason Solack
yes, i just ran the script from web2py's github repository and used the setting it provide... it was faster and more stable. On Sunday, April 17, 2016 at 9:34:40 PM UTC-4, kenny c wrote: > > was nignx faster than running on Apache as default setting? -- Resources: - http://web2py.com -

Re: [web2py] what's the best approach for view and update forms for multiple tables?

2016-04-20 Thread Richard Vézina
Hello Michael, I am not sure to understand what you are trying to acheive exactly and what is causing issue... On Wed, Apr 20, 2016 at 2:18 PM, Michael Beller wrote: > > The approach in the book for one form for multiple tables works well for > create forms: > >

[web2py] Re: deploy to pythonanywhere broken in >= 2.14.x version

2016-04-20 Thread 黄祥
yes, you all right, it back to normal right now, perhaps about the outage, but the same behaviour is still exist : usually the button show working in a couple minutes (depends on the apps deployed), yet in the 2.14.x version, the button show working just in few seconds, yet in the

[web2py] Re: Windows / 2.14.5 / Cannot import module

2016-04-20 Thread Anthony
On Wednesday, April 20, 2016 at 3:01:09 PM UTC-4, Kiran Subbaraman wrote: > > Yes, I do. Had installed the redis-client: `pip install redis` > Also, please note that this works with the web2py_src version, but not the > web2py-windows binary. > The Windows and OSX binaries include their own

[web2py] Re: Windows / 2.14.5 / Cannot import module

2016-04-20 Thread Dave S
On Wednesday, April 20, 2016 at 12:01:09 PM UTC-7, Kiran Subbaraman wrote: > > Yes, I do. Had installed the redis-client: `pip install redis` > Also, please note that this works with the web2py_src version, but not the > web2py-windows binary. > You may need to have it in the

[web2py] Re: Windows / 2.14.5 / Cannot import module

2016-04-20 Thread Kiran Subbaraman
Yes, I do. Had installed the redis-client: `pip install redis` Also, please note that this works with the web2py_src version, but not the web2py-windows binary. On Wednesday, April 20, 2016 at 11:45:02 PM UTC+5:30, Dave S wrote: > > > > On Wednesday, April 20, 2016 at 9:51:23 AM UTC-7, Kiran

[web2py] what's the best approach for view and update forms for multiple tables?

2016-04-20 Thread Michael Beller
The approach in the book for one form for multiple tables works well for create forms: http://web2py.com/books/default/chapter/29/07/forms-and-validators#One-form-for-multiple-tables I have not found a good method for view or update forms. I have a model: db.define_table('buyer',

[web2py] Re: Windows / 2.14.5 / Cannot import module

2016-04-20 Thread Dave S
On Wednesday, April 20, 2016 at 9:51:23 AM UTC-7, Kiran Subbaraman wrote: > > Downloaded Web2py for Windows: > http://www.web2py.com/examples/static/web2py_win.zip. > 2.14.5-stable+timestamp.2016.04.14.03.26.16 > (Running on Rocket 1.2.6, Python 2.7.9) > Windows 10 > > Unable to use the redis

[web2py] Re: built-in wiki

2016-04-20 Thread Dave S
On Wednesday, April 20, 2016 at 8:35:45 AM UTC-7, bria...@gmail.com wrote: > > I apologize. My initial question is not very clear so I'll rephrase it > more appropriately. > > The problem here is that when I link to the image it's saving it instead > of display it, and the latter is my

[web2py] Re: built-in wiki

2016-04-20 Thread Leonel Câmara
You can either make another download controller or use a request.vars to flag that you don't want the link to download, example making another controller function just for this: @cache.action() def download_noattach(): return response.download(request, db, attachment=False) -- Resources:

[web2py] Nginx, uwsgi, on Windows

2016-04-20 Thread Kiran Subbaraman
Hello all, I use Windows 10 based laptop for my development. By default, web2py serves its content via the rocket server. My application makes use of the 'default' redis client () to connect to the local redis server. I started noticing a stacktrace, in the cmd prompt, from within which web2py

[web2py] CodernityDB pure python nosql

2016-04-20 Thread Michele Comitini
Seems interesting! http://labs.codernity.com/codernitydb/ has anyone tried it? -- 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: How to change login form such that it will ask the field username (added to auth) instead of email?

2016-04-20 Thread Anthony
But why are you doing that? web2py already has built-in username functionality, and your custom code doesn't add anything to that, so why bother? Anyway, as it is, your code will result in auth.settings.use_username being set to False, which will result in the "Retrieve username" option being

[web2py] Re: built-in wiki

2016-04-20 Thread briannd81
I apologize. My initial question is not very clear so I'll rephrase it more appropriately. The problem here is that when I link to the image it's saving it instead of display it, and the latter is my intention. It looks like this feature is built into web2py. I think the following HTTP header

[web2py] Re: deploy to pythonanywhere broken in >= 2.14.x version

2016-04-20 Thread Giles Thomas
PythonAnywhere dev here -- we did have a four-minute outage at 04:11 UTC this morning, perhaps that was it? On Wednesday, April 20, 2016 at 12:34:23 PM UTC+1, Leonel Câmara wrote: > > Weird we didn't do any changes on our side. It was probably a temporary > error, I just tested deploying an

Re: [web2py] Re: ldap_auth, TLS implementation

2016-04-20 Thread Richard Vézina
we shouldn't test contribs as they should be tested somewhere else, though many of them don't have somewhere else place... :) auth_ldap fall in that category... On Wed, Apr 20, 2016 at 10:55 AM, Niphlod wrote: > on travis an openldap server can be installed but that being

Re: [web2py] Re: ldap_auth, TLS implementation

2016-04-20 Thread Niphlod
on travis an openldap server can be installed but that being said it's like opening a pandora's box : tests and coverage are really meant for anything NOT in contrib On Wednesday, April 20, 2016 at 4:31:11 PM UTC+2, Richard wrote: > > We should test ldap_auth... But how to with all the

Re: [web2py] Re: ldap_auth, TLS implementation

2016-04-20 Thread Richard Vézina
We should test ldap_auth... But how to with all the different implementation of LDAP... Simone, do you know if we can at least test Open LDAP easily? On Wed, Apr 20, 2016 at 10:29 AM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > :) > > On Wed, Apr 20, 2016 at 8:31 AM, Niphlod

Re: [web2py] Re: ldap_auth, TLS implementation

2016-04-20 Thread Richard Vézina
:) On Wed, Apr 20, 2016 at 8:31 AM, Niphlod wrote: > no problem. it's better a false bug report than noone checking the code at > all ^_^ > > > On Wednesday, April 20, 2016 at 1:08:18 PM UTC+2, flando wrote: >> >> >> right! my fault, didn't set "secure=True"... >> >> Thank

[web2py] Re: ldap_auth, TLS implementation

2016-04-20 Thread Niphlod
no problem. it's better a false bug report than noone checking the code at all ^_^ On Wednesday, April 20, 2016 at 1:08:18 PM UTC+2, flando wrote: > > > right! my fault, didn't set "secure=True"... > > Thank you Niphlod! > -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Combobox- Formulário

2016-04-20 Thread Leonel Câmara
Oi Giovanna, Please write in English as this is an international group. Instead of your commented out INPUT(_name='campus') use something like SELECT(OPTION('Escolha um Campus', _value=''), OPTION('Rio', _value='rio'), _name='campus') -- Resources: - http://web2py.com -

[web2py] Re: deploy to pythonanywhere broken in >= 2.14.x version

2016-04-20 Thread Leonel Câmara
Weird we didn't do any changes on our side. It was probably a temporary error, I just tested deploying an application and it worked. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: ldap_auth, TLS implementation

2016-04-20 Thread flando
right! my fault, didn't set "secure=True"... Thank you Niphlod! -- 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: ldap_auth, TLS implementation

2016-04-20 Thread Niphlod
https://github.com/web2py/web2py/blob/master/gluon/contrib/login_methods/ldap_auth.py#L608 On Wednesday, April 20, 2016 at 9:37:25 AM UTC+2, flando wrote: > > we are using 2.13.4, in this version it is missing. > sorry for my post if it meanwhile got integrated! :) > > -- Resources: -

[web2py] Re: ldap_auth, TLS implementation

2016-04-20 Thread flando
we are using 2.13.4, in this version it is missing. sorry for my post if it meanwhile got integrated! :) -- 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: ldap_auth, TLS implementation

2016-04-20 Thread Niphlod
ahem isn't this added yet when cacert is not None ? On Wednesday, April 20, 2016 at 9:14:32 AM UTC+2, flando wrote: > > Hi > > To have ldap over tls working I had to add the following lines > in gluon/contrib/login_methods/ldap_auth.py to regard the cert file: > > 567 def init_ldap( > >

[web2py] ldap_auth, TLS implementation

2016-04-20 Thread flando
Hi To have ldap over tls working I had to add the following lines in gluon/contrib/login_methods/ldap_auth.py to regard the cert file: 567 def init_ldap( 601 if tls: +602 if cacert_file: +603 ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,