On Aug 19, 2009, at 11:25 PM, ed wrote:

>
> I didn't change the gluon directory and inserted the code below in
> db.py and was able to run the app. I inserted 2 fields and tried to
> run it again but encountered the error ticket below.

Are you calling auth.define_tables()? You still need to call it, after  
you've defined the fields.


>
> from gluon.tools import *
> auth=Auth(globals(),db)                      # authentication/
> authorization
> auth.settings.hmac_key='<your secret key>'
> #auth.define_tables()                         # creates all needed
> tables
> auth.settings.table_user = db.define_table("auth_user",db.Field
> ("first_name",length=128,default=""),
>                           db.Field("last_name",
> length=128,default=""),
>                           db.Field("email",
> length=128,default=""),
>                           db.Field
> ("password",'password',readable=False,
>                                     writable=False,label="Password"),
>                           db.Field("registration_key", length=128,
>                                     writable=False, readable=False,
> default=""),
>                           db.Field("birthdate", 'date',
> label="Birthdate"),
>                           db.Field("gender", length=6, default="",
> label="Gender"))
> db.auth_user.password.requires=[]
> **********************************************
> I got this error ticket.
> Error traceback
> Traceback (most recent call last):
>  File "gluon/restricted.py", line 178, in restricted
>  File "C:/Python25/web2py/applications/Alumni/controllers/
> default.py", line 55, in <module>
>  File "gluon/globals.py", line 101, in <lambda>
>  File "C:/Python25/web2py/applications/Alumni/controllers/
> default.py", line 34, in user
>  File "gluon/tools.py", line 477, in __call__
>  File "gluon/tools.py", line 827, in login
>  File "gluon/tools.py", line 642, in log_event
> AttributeError: 'NoneType' object has no attribute 'insert'
> ************************************************
> I don't know what this message is, can someone give me an idea. Thanks
> >



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to