Issue with tools.py auth_permission table definition

12 views
Skip to first unread message

Fran

unread,
Mar 20, 2009, 3:54:13 PM3/20/09
to web2py Web Framework
This definition includes:
db.auth_permission.table_name.requires = IS_IN_SET(db.tables)

Problem is that db.tables is evaluated when the Auth class is
instantiated
=> only contains those tables created up to that point in the model

Workaround is to explictly call that line at the end of the model(s).

Not sure how to fix the class definition to avoid this.

If we can't then we should update documentation.

F

Yarko Tymciurak

unread,
Mar 20, 2009, 5:17:34 PM3/20/09
to web...@googlegroups.com
... so you find the default db.py comments ("Define your tables below")  not clear enough, is that correct?

Would changing the default (welcome)  db.py to look like something like this help:

#####################---< your tables section >---############################
## Define your tables below,   for example
##
## >>> db.define_table('mytable',SQLField('myfield','string'))
....
########################################################################

# your table definitions (define before the Auth Section) #

##
#################---< END your tables section >--############################


#####################-- Auth Section --################################
## Here is sample code if you need:
## - email capabilities
.....
Reply all
Reply to author
Forward
0 new messages