Looks like the OpenIDAuth uses the reserved keyword "user" for the name of
a field.
On Monday, December 31, 2012 7:00:14 AM UTC-7, mweissen wrote:
>
> Hi,
> I want to try OpenID. I have found the following chapter in the book (rev.
> 4.9):
>
> ---------------------------------
> OpenID
>
> We have previously discussed integration with Janrain (which has OpenID
> support) and that is the easiest way to use OpenID. Yet sometimes you do
> not want to rely on a third party service and you want to access the OpenID
> provider directly from the consumer (your app).
>
> Here is an example:
>
> from gluon.contrib.login_methods.openid_auth import OpenIDAuth
> auth.settings.login_form = OpenIDAuth(auth)
>
> OpenIDAuth requires the *python-openid* module to be installed
> separately. Under the hood, this login method defines the following table:
>
> db.define_table('alt_logins',
> Field('username', length=512, default=''),
> Field('type', length =128, default='openid', readable=False),
> Field('user', self.table_user, readable=False))
>
> which stores the openid usernames for each user. If you want to display
> the openids for the current logged in user:
>
> {{=auth.settings.login_form.list_user_openids()}}
>
> ---------------------------------
>
>
> I created a new application and I added this line at the top of db.py
>
> from gluon.contrib.login_methods.openid_auth import OpenIDAuth
>
> This line is at the end:
>
> auth.settings.login_form = OpenIDAuth(auth)
>
> After starting the index-function I got the following error message:
> <type 'exceptions.SyntaxError'> invalid table/column name "type" is a
> "ALL" reserved SQL keyword
> Version
> web2py™ (2, 3, 2, datetime.datetime(2012, 12, 19, 11, 52, 16), 'dev')
> Python Python 2.7.3: D:\Python27\python.exe
> Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
>
> Traceback (most recent call last):
> File "D:\dropbox\InfoSMS\web2py\gluon\restricted.py", line 212, in
> restricted
>
>
> exec ccode in environment
> File "D:/dropbox/InfoSMS/web2py/applications/logins/models/db.py"
> <http://127.0.0.1:8000/admin/default/edit/logins/models/db.py>, line 88, in
> <module>
>
>
> auth.settings.login_form = OpenIDAuth(auth)
>
>
> File
> "D:\dropbox\InfoSMS\web2py\gluon\contrib\login_methods\openid_auth.py", line
> 103, in __init__
>
>
> self._define_alt_login_table()
> File
> "D:\dropbox\InfoSMS\web2py\gluon\contrib\login_methods\openid_auth.py", line
> 143, in _define_alt_login_table
>
>
> Field('user', self.table_user, readable=False),
>
>
> File "D:\dropbox\InfoSMS\web2py\gluon\dal.py", line 7186, in define_table
>
>
> table = self.lazy_define_table(tablename,*fields,**args)
>
>
> File "D:\dropbox\InfoSMS\web2py\gluon\dal.py", line 7203, in
> lazy_define_table
>
>
> table = table_class(self, tablename, *fields, **args)
>
>
> File "D:\dropbox\InfoSMS\web2py\gluon\dal.py", line 7609, in __init__
>
>
> db.check_reserved_keyword(field_name)
> File "D:\dropbox\InfoSMS\web2py\gluon\dal.py", line 6930, in
> check_reserved_keyword
>
>
> 'invalid table/column name "%s" is a "%s" reserved SQL keyword' % (name,
> backend.upper()))
>
> SyntaxError: invalid table/column name "type" is a "ALL" reserved SQL keyword
>
> Error snapshot [image: help]
>
> <type 'exceptions.SyntaxError'>(invalid table/column name "type" is a
> "ALL" reserved SQL keyword)
> Any comments?
> Regards, Martin
>
>
--