[web2py] Re: SQL strings and SQLTABLE issue in last web2py release. Is there a solution for it?

2018-03-14 Thread Anthony
Looks like the problem was introduced here 

 
(and updated here 
).
 
Feel free to open an issue on Github.

Anthony

On Wednesday, March 14, 2018 at 6:32:46 PM UTC-4, Paolo Caruccio wrote:
>
> The relevant code that generates the issue is:
>
>
>
> rischi_della_mansione = "GROUP_CONCAT(rischio, ', ')"
>
>
> l = [db.RISCHI_MANSIONE.on(
> (db.RISCHI_MANSIONE.mansione_ID==db.MANSIONE.id)),
>  db.RISCHI.on(
> (db.RISCHI.id==db.RISCHI_MANSIONE.rischio_ID))
> ]
>
>
> mansioni = db((db.MANSIONE.id>0)).select(db.MANSIONE.mansione,
>  rischi_della_mansione,
>  left=l,
>  groupby=db.MANSIONE.id
> )
>
>
> fattori_rischio = SQLTABLE(mansioni,
>truncate=None,
>_id="rischi",
>headers={'MANSIONE.mansione':'MANSIONE',
> rischi_della_mansione:'FATTORI DI 
> RISCHIO'
> },
> columns=['MANSIONE.mansione',
>  rischi_della_mansione
> ]
> )
>
> The traceback screenshot is:
>
>
> 
>
>
>
> Please note that the code is working well on web2py Version 
> 2.14.6-stable+timestamp.2016.05.10.00.21.47
>
> Has anybody found the same issue and solved it?
>
> Thank you.
>
>
>
>
>
>

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQL strings and SQLTABLE issue in last web2py release. Is there a solution for it?

2018-03-14 Thread Paolo Caruccio
Hi Dave.

Yes, I am running on Windows 8 with stand-alone Python. I am using the 
source downloaded from github this evening. The pydal version is 17.11
The same issue is on a production server Ubuntu 16.04 with nginx and uwsgi 
and latest stable version of web2py
The database is SQLite 3 in both configurations.


Il giorno giovedì 15 marzo 2018 00:00:01 UTC+1, Dave S ha scritto:
>
>
>
> On Wednesday, March 14, 2018 at 3:32:46 PM UTC-7, Paolo Caruccio wrote:
>>
>> The relevant code that generates the issue is:
>>
> [...] 
>
>> The traceback screenshot is:
>>
>
>>
>> 
>>  
>>
>
>> Please note that the code is working well on web2py Version 
>> 2.14.6-stable+timestamp.2016.05.10.00.21.47
>>
>> Has anybody found the same issue and solved it?
>>
>> Thank you.
>>
>>
>>  
> I see you're running on Windows but with a stand-alone Python.  Are you 
> using the source download of web2py?  What version of pydal do you have?
>
> /dps
>
>

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Backwards compatibility

2018-03-14 Thread Leonel Câmara
This is due to the welcome app, since it does not include tooltips it 
doesn't really need it.

That said, in made a pull request which improves bootstrap 4 support, one 
of the things I did was to include popper.js which serves the same purpose 
as tether in BS3
https://github.com/web2py/web2py/pull/1876

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQL strings and SQLTABLE issue in last web2py release. Is there a solution for it?

2018-03-14 Thread Dave S


On Wednesday, March 14, 2018 at 3:32:46 PM UTC-7, Paolo Caruccio wrote:
>
> The relevant code that generates the issue is:
>
>
>
> rischi_della_mansione = "GROUP_CONCAT(rischio, ', ')"
>
>
> l = [db.RISCHI_MANSIONE.on(
> (db.RISCHI_MANSIONE.mansione_ID==db.MANSIONE.id)),
>  db.RISCHI.on(
> (db.RISCHI.id==db.RISCHI_MANSIONE.rischio_ID))
> ]
>
>
> mansioni = db((db.MANSIONE.id>0)).select(db.MANSIONE.mansione,
>  rischi_della_mansione,
>  left=l,
>  groupby=db.MANSIONE.id
> )
>
>
> fattori_rischio = SQLTABLE(mansioni,
>truncate=None,
>_id="rischi",
>headers={'MANSIONE.mansione':'MANSIONE',
> rischi_della_mansione:'FATTORI DI 
> RISCHIO'
> },
> columns=['MANSIONE.mansione',
>  rischi_della_mansione
> ]
> )
>
> The traceback screenshot is:
>
>
> 
>
>
>
> Please note that the code is working well on web2py Version 
> 2.14.6-stable+timestamp.2016.05.10.00.21.47
>
> Has anybody found the same issue and solved it?
>
> Thank you.
>
>
>
>
>
>

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQL strings and SQLTABLE issue in last web2py release. Is there a solution for it?

2018-03-14 Thread Paolo Caruccio
The relevant code that generates the issue is:



rischi_della_mansione = "GROUP_CONCAT(rischio, ', ')"


l = [db.RISCHI_MANSIONE.on(
(db.RISCHI_MANSIONE.mansione_ID==db.MANSIONE.id)),
 db.RISCHI.on(
(db.RISCHI.id==db.RISCHI_MANSIONE.rischio_ID))
]


mansioni = db((db.MANSIONE.id>0)).select(db.MANSIONE.mansione,
 rischi_della_mansione,
 left=l,
 groupby=db.MANSIONE.id
)


fattori_rischio = SQLTABLE(mansioni,
   truncate=None,
   _id="rischi",
   headers={'MANSIONE.mansione':'MANSIONE',
rischi_della_mansione:'FATTORI DI 
RISCHIO'
},
columns=['MANSIONE.mansione',
 rischi_della_mansione
]
)

The traceback screenshot is:





Please note that the code is working well on web2py Version 
2.14.6-stable+timestamp.2016.05.10.00.21.47

Has anybody found the same issue and solved it?

Thank you.





-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-03-14 Thread Jim S
Awesome, I forgot about that post.

-Jim

On Wednesday, March 14, 2018 at 2:08:07 PM UTC-5, pbreit wrote:
>
> You might also check:
> https://github.com/web2py/scaffold
>

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-03-14 Thread pbreit
You might also check:
https://github.com/web2py/scaffold

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Backwards compatibility

2018-03-14 Thread Richard Vézina
Which version of web2py are you using?

Are you talking of a new app you just created with web2py admin interface
(which is base on welcome app)??

If so, it mays exist some issue with the welcome app that need to be
resolved.

Please add details here, eventually it may lead to a issue to be created
over github web2py repository if we can reproduce the problem.

Thanks

Richard

On Wed, Mar 7, 2018 at 5:40 PM, Mark Erbaugh 
wrote:

> I appreciate Web2py's view towards backwards compatibility, but I think
> some of the included libraries do not share the same philosophy. I have had
> to make changes eliminate errors or have expected functionality. I would
> like to know if I'm doing this right and if I've missed something.
>
> If you view pages using developer tools, you see an error message that
> Bootstrap tooltips require Tether. I solved this by downloading tether.min
> ad additing it to layout.html.
>
> In the admin mode, if you try and edit a table with a list field, the +
> and - icons are missing. The buttons are there, just blank. I solved this
> by adding glyhpicons.css to layout.html which uses Glyphicons Halflings
> font. Interestingly, the glyicons-haflings files referenced were already in
> the statc\fonts directory.
>
> Thanks,
> Mark
>
>
>
>
>
>
> --
> 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 Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-03-14 Thread Richard Vézina
It debian package... If you goes with pip it should be python-ldap...

Good luck

Richard

On Wed, Mar 14, 2018 at 3:57 AM, Johann Spies 
wrote:

> Thanks Richard for your attention.
>
> I have checked my setup again and saw that I had the debian-package
> python3-ldap3 and not python3-ldap.
>
> I have installed  python3-ldap and now it works - at least so far for
> importing:
>
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
>
> Regards
> Johann
>
> On 13 March 2018 at 19:05, Richard Vézina 
> wrote:
> > It might not be an issue with auth_ldap.py
> >
> > On Tue, Mar 13, 2018 at 12:29 PM, Richard Vézina
> >  wrote:
> >>
> >> It works fine...
> >>
> >> On Tue, Mar 13, 2018 at 12:28 PM, Richard Vézina
> >>  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("ldaps://{s}:{p}".format(s=server, p=636))
> >>> l.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)
> >>> # l.set_option(ldap.OPT_X_TLS_CACERTFILE, 'path/to/ca.pem')  # Wasn't
> >>> required...
> >>> l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap. OPT_X_TLS_NEVER)
> >>> l.set_option(ldap.OPT_X_TLS_NEWCTX, 0)
> >>>
> >>> Then it connected properly under python3 only...
> >>>
> >>> Will make some test in python2 if the back port of the above cause any
> >>> issue...
> >>>
> >>> Richard
> >>>
> >>>
> >>> On Tue, Mar 13, 2018 at 11:58 AM, Richard Vézina
> >>>  wrote:
> 
>  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.
> 
>  Thanks
> 
>  Richard
> 
> 
>  On Tue, Mar 13, 2018 at 11:39 AM, Richard Vézina
>   wrote:
> >
> > 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
> >  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 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 over importing setuptools issue... Setuptools
> is
> >> installed, so I wonder what going on...
> >>
> >> It seems to be working with python 3.4+ :
> >> https://www.python-ldap.org/en/latest/installing.html#
> build-prerequisites
> >>
> >> If you have ubuntu you can try on your side :
> >>
> >> sudo pip3 install -U setuptools
> >> sudo pip3 install python-ldap
> >>
> >>
> >> It would be nice if python-ldap just works under python3 as we
> >> wouldn't have to touch ldap_auth.py as python-ldap should have keep
> the same
> >> API under python3...
> >>
> >> Though ldap3 seems to offer interresting progres, but I didn't try
> it.
> >>
> >> Please keep posting here your progress.
> >>
> >> Thanks
> >>
> >> Richard
> >>
> >>
> >>
> >> On Tue, Mar 13, 2018 at 8:32 AM, Johann Spies <
> johann.sp...@gmail.com>
> >> wrote:
> >>>
> >>> 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, locals, fromlist, level)
> >>> 109 import_tb = None
> >>> 110
> >>> --> 111 return NATIVE_IMPORTER(name, globals, locals, fromlist,
> >>> level)
> >>> 112
> >>> 113
> >>>
> >>> /home/js/web2py/gluon/contrib/login_methods/ldap_auth.py in
> >>> ()
> >>>  12 except Exception as e:
> >>>  13 logging.error('missing ldap, try "easy_install
> >>> python-ldap"')
> >>> ---> 14 raise e
> >>>  15
> >>>  16
> >>>
> >>> /home/js/web2py/gluon/contrib/login_methods/ldap_auth.py in
> >>> ()
> >>>   7 import logging
> >>>   8 try:
> >>> > 9 import ldap
> >>>  10 import ldap.filter
> >>>  11 

[web2py] Re: call to PUT restapi from angular

2018-03-14 Thread Leonel Câmara
That said, a simple solution is simply to use POST instead of PUT.

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Select returns non existent fields

2018-03-14 Thread Anthony
On Wednesday, March 14, 2018 at 7:32:18 AM UTC-4, Simona Chovancová wrote:
>
> Hello, I have a problem with select.. I have these tables defined:
> db.define_table(
> 'email',
> Field('recipient', 'string', notnull=True),
> Field('subject', 'string', length=256, notnull=False),
> Field('body', 'text', notnull=False),
> Field('html_body', 'text', notnull=False),
> )
>
> self.db.define_table(
> 'attachment',
> Field('file_blob_id'),
> Field('email_id', db.email, notnull=False)
> )
>
> When I insert something into email table and make select like 
> db(db.email).slelect(), it returns something like this:
>
>  'randomtext', 'html_body': '', 'attachment':  27)>, 'id': 27L}>
>
>
The "attachment" attribute of the Row object is not a field that has been 
selected from the database and does not involve any data being retrieved 
from the database. Rather, it is simply a DAL Set object that can be used 
to retrieve related records from the db.attachment table -- you would use 
it as follows:

attachments_associated_with_this_email = row.attachment.select()

For details, 
see 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Recursive-selects.

If you really need to get rid of that attribute for some reason, you can do 
so via:

db(db.email).select(cacheable=True)

When cacheable=True, the DAL excludes any Row attributes that cannot be 
pickled, such as the "update_record", "delete_record", and any Set 
attributes.

Anthony

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: call to PUT restapi from angular

2018-03-14 Thread Leonel Câmara
Humm arguably this could be supported by web2py then. It would be easy for 
the restful decorator to automatically provide an OPTIONS handler.

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Select returns non existent fields

2018-03-14 Thread Leonel Câmara
Are you setting an attachment virtual field on the email somewhere?

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Select returns non existent fields

2018-03-14 Thread Leonel Câmara


quarta-feira, 14 de Março de 2018 às 11:32:18 UTC, Simona Chovancová 
escreveu:
>
> Hello, I have a problem with select.. I have these tables defined:
> db.define_table(
> 'email',
> Field('recipient', 'string', notnull=True),
> Field('subject', 'string', length=256, notnull=False),
> Field('body', 'text', notnull=False),
> Field('html_body', 'text', notnull=False),
> )
>
> self.db.define_table(
> 'attachment',
> Field('file_blob_id'),
> Field('email_id', db.email, notnull=False)
> )
>
> When I insert something into email table and make select like 
> db(db.email).slelect(), it returns something like this:
>
> ',   'subject': 'sub',  
> 'body': 
> 'randomtext', 'html_body': '', 'attachment':  27)>, 'id': 27L}>
>
> Why is there the attachment field? How do I remove it to just select real 
> fields and not relations with other tables? Thank you.
>

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Select returns non existent fields

2018-03-14 Thread Simona Chovancová
Hello, I have a problem with select.. I have these tables defined:
db.define_table(
'email',
Field('recipient', 'string', notnull=True),
Field('subject', 'string', length=256, notnull=False),
Field('body', 'text', notnull=False),
Field('html_body', 'text', notnull=False),
)

self.db.define_table(
'attachment',
Field('file_blob_id'),
Field('email_id', db.email, notnull=False)
)

When I insert something into email table and make select like 
db(db.email).slelect(), it returns something like this:

, 'id': 27L}>

Why is there the attachment field? How do I remove it to just select real 
fields and not relations with other tables? Thank you.

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-03-14 Thread Johann Spies
Thanks Richard for your attention.

I have checked my setup again and saw that I had the debian-package
python3-ldap3 and not python3-ldap.

I have installed  python3-ldap and now it works - at least so far for importing:

from gluon.contrib.login_methods.ldap_auth import ldap_auth

Regards
Johann

On 13 March 2018 at 19:05, Richard Vézina  wrote:
> It might not be an issue with auth_ldap.py
>
> On Tue, Mar 13, 2018 at 12:29 PM, Richard Vézina
>  wrote:
>>
>> It works fine...
>>
>> On Tue, Mar 13, 2018 at 12:28 PM, Richard Vézina
>>  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("ldaps://{s}:{p}".format(s=server, p=636))
>>> l.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)
>>> # l.set_option(ldap.OPT_X_TLS_CACERTFILE, 'path/to/ca.pem')  # Wasn't
>>> required...
>>> l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap. OPT_X_TLS_NEVER)
>>> l.set_option(ldap.OPT_X_TLS_NEWCTX, 0)
>>>
>>> Then it connected properly under python3 only...
>>>
>>> Will make some test in python2 if the back port of the above cause any
>>> issue...
>>>
>>> Richard
>>>
>>>
>>> On Tue, Mar 13, 2018 at 11:58 AM, Richard Vézina
>>>  wrote:

 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.

 Thanks

 Richard


 On Tue, Mar 13, 2018 at 11:39 AM, Richard Vézina
  wrote:
>
> 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
>  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 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 over importing setuptools issue... Setuptools is
>> installed, so I wonder what going on...
>>
>> It seems to be working with python 3.4+ :
>> https://www.python-ldap.org/en/latest/installing.html#build-prerequisites
>>
>> If you have ubuntu you can try on your side :
>>
>> sudo pip3 install -U setuptools
>> sudo pip3 install python-ldap
>>
>>
>> It would be nice if python-ldap just works under python3 as we
>> wouldn't have to touch ldap_auth.py as python-ldap should have keep the 
>> same
>> API under python3...
>>
>> Though ldap3 seems to offer interresting progres, but I didn't try it.
>>
>> Please keep posting here your progress.
>>
>> Thanks
>>
>> Richard
>>
>>
>>
>> On Tue, Mar 13, 2018 at 8:32 AM, Johann Spies 
>> wrote:
>>>
>>> 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, locals, fromlist, level)
>>> 109 import_tb = None
>>> 110
>>> --> 111 return NATIVE_IMPORTER(name, globals, locals, fromlist,
>>> level)
>>> 112
>>> 113
>>>
>>> /home/js/web2py/gluon/contrib/login_methods/ldap_auth.py in
>>> ()
>>>  12 except Exception as e:
>>>  13 logging.error('missing ldap, try "easy_install
>>> python-ldap"')
>>> ---> 14 raise e
>>>  15
>>>  16
>>>
>>> /home/js/web2py/gluon/contrib/login_methods/ldap_auth.py in
>>> ()
>>>   7 import logging
>>>   8 try:
>>> > 9 import ldap
>>>  10 import ldap.filter
>>>  11 ldap.set_option(ldap.OPT_REFERRALS, 0)
>>>
>>> /home/js/web2py/gluon/custom_import.py in custom_importer(name,
>>> globals, locals, fromlist, level)
>>> 102 return NATIVE_IMPORTER(name, globals, locals,
>>> fromlist, level)
>>> 103 except (ImportError, KeyError) as e3:
>>> --> 104 raise ImportError(e1, import_tb)  # there an
>>> import error in the module
>>> 105 except Exception as e2:

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

2018-03-14 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 surprised to see it, but you can try 
doing a 

def UpdateAgenda():
   def OPTIONS: 
  return "POST,OPTIONS"
   [...]


Note:  in my node.js code where I handle OPTIONS, I have both returning a 
string as above and returning JSON.  I haven't worked with it recently 
enough to remember what the traces looked like.

/dps

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.