Re: [web2py] Re: call to PUT restapi from angular

2018-03-13 Thread Dave S
On Tuesday, March 13, 2018 at 9:25:44 PM UTC-7, yogeshwar khalkar wrote: > > Hi Leonel, > > print request.env.request_method > > prints - "OPTIONS" > > Thanks, > Yogeshwar > > Ah, the Angular library is doing a two-step. OPTIONS is a request for the supported (HTTP) verbs. I'm kind of surpri

Re: [web2py] Re: call to PUT restapi from angular

2018-03-13 Thread yogeshwar khalkar
Hi Leonel, print request.env.request_method prints - "OPTIONS" Thanks, Yogeshwar On Wed, Mar 14, 2018 at 2:19 AM, Val K wrote: > And keep in mind that 'return locals()' should be related to updateAgenda, > not PUT + I think it should be PUT(id, **kw) because you pass additional > payload, ot

[web2py] Re: call to PUT restapi from angular

2018-03-13 Thread Val K
And keep in mind that 'return locals()' should be related to updateAgenda, not PUT + I think it should be PUT(id, **kw) because you pass additional payload, otherwise you'll get 'bad request' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/

Re: [web2py] Re: Using vue.js as my front end

2018-03-13 Thread Marco Mansilla
Roberto's work it's really nice and valuable, we still need to drop the nodejs dependency somehow, and use js tools without worrying about node or npm. Something like using js modules in the browser would be nice. You can read about it in the following links. https://www.contentful.com/blog/2017/

[web2py] Re: Using vue.js as my front end

2018-03-13 Thread Leonel Câmara
You can look at AuthAPI tests https://github.com/web2py/web2py/blob/master/gluon/tests/test_authapi.py But a login controller could be as simple as this: Model: from gluon.authapi import AuthAPI auth = AuthAPI(db) controller def login(): return response.json(auth.login(**request.vars)) U

Re: [web2py] Re: Using vue.js as my front end

2018-03-13 Thread Jim S
Perfect! Thanks Richard, that should keep me busy for a while. -Jim On Tuesday, March 13, 2018 at 12:08:56 PM UTC-5, Richard wrote: > > Maybe here : https://github.com/robertop23/web2py_vuejs_vuetify > > There is a initiative to create a scafold web2py app base on vue.js... > > Richard > > On Tu

Re: [web2py] Re: Using vue.js as my front end

2018-03-13 Thread Richard Vézina
Maybe here : https://github.com/robertop23/web2py_vuejs_vuetify There is a initiative to create a scafold web2py app base on vue.js... Richard On Tue, Mar 13, 2018 at 1:07 PM, Jim S wrote: > Thanks for that! > > Any example code anywhere on how to implement login and then subsequent > page cal

[web2py] Re: Using vue.js as my front end

2018-03-13 Thread Jim S
Thanks for that! Any example code anywhere on how to implement login and then subsequent page calls passing the logged in user or session information? -Jim On Tuesday, March 13, 2018 at 12:00:44 PM UTC-5, Leonel Câmara wrote: > > Look at AuthAPI which is Auth's base class > > https://github.com

Re: [web2py] Bug in ldap library for python3?

2018-03-13 Thread Richard Vézina
It might not be an issue with auth_ldap.py On Tue, Mar 13, 2018 at 12:29 PM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > It works fine... > > On Tue, Mar 13, 2018 at 12:28 PM, Richard Vézina < > ml.richard.vez...@gmail.com> wrote: > >> I try with a module of mine using ldap and had iss

[web2py] Re: Using vue.js as my front end

2018-03-13 Thread Leonel Câmara
Look at AuthAPI which is Auth's base class https://github.com/web2py/web2py/blob/master/gluon/authapi.py It works pretty much like Auth except that it's based in dictionaries, its functions get dictionaries as arguments and returns dictionaries, which is pretty much what people usually want whe

[web2py] Re: call to PUT restapi from angular

2018-03-13 Thread Leonel Câmara
I don't see how you can be getting that error if you're actually sending a PUT request (I can see how you could be getting other errors since for instance web2py parses json in the request and puts it in vars) Put something like print request.env.request_method In your first model and see what

[web2py] Using vue.js as my front end

2018-03-13 Thread Jim S
Hi Can someone point me to some docs on how to do authentication with vue.js? I'm looking to use web2py just to pass json data to/from my vue.js front end. I have no idea how to do the authentication and passing it to all my REST calls. Is there a section in the book that shows how to do t

Re: [web2py] Bug in ldap library for python3?

2018-03-13 Thread Richard Vézina
It works fine... On Tue, Mar 13, 2018 at 12:28 PM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > I try with a module of mine using ldap and had issues with ldapS > connection... > > I had to follow this : > > https://github.com/python-ldap/python-ldap/issues/55 > > l = ldap.initialize("l

Re: [web2py] Bug in ldap library for python3?

2018-03-13 Thread Richard Vézina
I try with a module of mine using ldap and had issues with ldapS connection... I had to follow this : https://github.com/python-ldap/python-ldap/issues/55 l = ldap.initialize("ldaps://{s}:{p}".format(s=server, p=636)) l.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3) # l.set_option(ldap.OPT

Re: [web2py] Bug in ldap library for python3?

2018-03-13 Thread Richard Vézina
Please try this : sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev # setuptools should be there... I was miss leading... sudo pip3 install python-ldap Please provide progress as if auth_ldap.py works properly with python3 once you install python-ldap properly under python3. T

Re: [web2py] Bug in ldap library for python3?

2018-03-13 Thread Richard Vézina
I open this issue : https://github.com/python-ldap/python-ldap/issues/181 On Tue, Mar 13, 2018 at 11:03 AM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > python3-ldap -> ldap3 (https://pypi.python.org/pypi/python3-ldap/0.9.8.4/) > is not the same thing as python-ldap... > > It seems tha

Re: [web2py] Bug in ldap library for python3?

2018-03-13 Thread Richard Vézina
python3-ldap -> ldap3 (https://pypi.python.org/pypi/python3-ldap/0.9.8.4/) is not the same thing as python-ldap... It seems that python-ldap support python 3 : https://github.com/python-ldap/python-ldap Saddly enough, I hadn't successfully install python-ldap under python3 with pip3... It fails

Re: [web2py] Book need update on recaptcha v2

2018-03-13 Thread Richard Vézina
Can you update the book and send a Pull Request through github?? Thank you Richard On Thu, Mar 8, 2018 at 7:28 PM, Alexander Scarlat MD wrote: > > As of 2018 March 31 Google doesn't support reCaptcha V1 anymore. > I thought the book should be updated with the following modification: > > instea

Re: [web2py] Re: call to PUT restapi from angular

2018-03-13 Thread yogeshwar khalkar
Still don't work. It returns 405 method not found. On Mar 13, 2018 7:00 PM, "Leonel Câmara" wrote: > You're missing a return locals() > > > @request.restful() > def updateAgenda(): > > def PUT(id): > data = json(request.body.read()) > ret = db(db.agenda.id >

[web2py] Re: call to PUT restapi from angular

2018-03-13 Thread Leonel Câmara
You're missing a return locals() @request.restful() def updateAgenda(): def PUT(id): data = json(request.body.read()) ret = db(db.agenda.id == id]).update(**data)

[web2py] call to PUT restapi from angular

2018-03-13 Thread yogeshwar khalkar
Hi, I want to update table on PUT call from angular but, Angular PUT request is not recognised by Web2Py PUT restapi. Here is angular code: this.http.put('http://127.0.0.1:8000/automation/workflow/updateAgenda/'+this.id, JSON.stringify(data)).subscribe(res=>{ console.log(res); }) Here is W

[web2py] Bug in ldap library for python3?

2018-03-13 Thread Johann Spies
Version 2.16.1 In python (2.7) I can do: python web2py.py -S welcome .. In [1]: from gluon.contrib.login_methods.ldap_auth import ldap_auth In [2]: But not when I use python3 (and I have python3-ldap installed). ``` /home/js/web2py/gluon/custom_import.py in custom_importer(name, globals, loc