Unable to add auth.signature in table - PY4WEB

65 views
Skip to first unread message

sandeep patel

unread,
Sep 21, 2019, 10:20:02 AM9/21/19
to web2py-users
Hello,

I am getting an error to add auth.signature in the table.

#model.py
from . import common
auth = common.auth

db.define_table('organization_info',
Field('name'),
Field('date_of_birth', 'date'),
Field('village'),
Field('block'),
Field('district'),
Field('state'),
Field('country'),
Field('pin'),
auth.signature
)



Thanks
SP
error_p.PNG

Massimo Di Pierro

unread,
Sep 21, 2019, 11:37:46 AM9/21/19
to web2py-users
Minor change of behavior. In py4web you need auth.signature() notice the ()

sandeep patel

unread,
Sep 22, 2019, 2:56:27 AM9/22/19
to web...@googlegroups.com
Now, I am getting another error.

#model
db.define_table('organization_info',
Field('name'),
Field('date_of_birth', 'date'),
Field('village'),
Field('block'),
Field('district'),
Field('state'),
Field('country'),
Field('pin'),
auth.signature()
)




--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/48a3766b-dbac-4841-88f6-695e4f124d8f%40googlegroups.com.
new_error.PNG

Massimo Di Pierro

unread,
Sep 22, 2019, 8:48:53 PM9/22/19
to web2py-users
 The problem is that your code is executed before

auth.enable()

in common.py. The above statement defines the auth_user table.
I will refactor the scaffolding app to make sure common.py is imported before models.py

Massimo Di Pierro

unread,
Sep 22, 2019, 9:00:43 PM9/22/19
to web2py-users
Posted a new _scaffold. Now both db and auth are defined in common. If you import common from models, you are fine.

sandeep patel

unread,
Sep 25, 2019, 2:01:29 PM9/25/19
to web...@googlegroups.com
Massimo, Thanks a lot. Now it's working fine.


Thanks
Sandeep Patel

--
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+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages