That's not the error you would get if you were using a reserved word. The problem is that at that point in the code execution, the db object has not been defined. Note, when you click the database admin button, the appadmin.py controller is executed. Is your db object defined in another controller (rather than in a model file)? It's hard to say what's going on without seeing more code.
Anthony On Sunday, August 28, 2016 at 8:41:17 PM UTC-4, Brian Boatright wrote: > > I've tried adding a model for "Containers" and "ContainerTypes" each time > I get an error when it tries to create the tables when I click the Database > Admin button. > > The other tables I'm defining are working fine. I have a few other tables > that have "Type" in their mode/table name so when I couldn't create > "containers" table. > > I've looked at MySQL and MariaDB (which I'm using) and do not see > "container" or something similar listed as a reserved word. > > here is the error > > <type 'exceptions.NameError'> name 'db' is not defined > > > db.define_table('containers', > Field('parentid','reference containers'), > Field('name','string')) > > *Traceback (most recent call last):* > >> File "C:\dev\web2py\gluon\restricted.py", line 227, in restricted >> exec ccode in environment >> File "C:/dev/web2py/applications/partsbin/models/containers.py", line >> 2, in <module> >> db.define_table('containers', >> NameError: name 'db' is not defined > > -- 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.