Perfect! This thread solved at least one major headache, and perhaps another even greater headache. Massimo, I'm embarrassed I had not tried grep. It worked. I found the string in the db_wizard_populate.py file. I used the wizard to quickly recreate my app's database structure when I couldn't get the migrate to work.
And speaking of problems migrating, Richard may have provided me with the missing info I needed for migration. I knew that it was the auth tables that were problematic, but I was so busy trying to mix up migrate and fake_migrate True settings that I never thought to set them to migrate=False. I'll try that next time and see if it works. If that is a known issue, it would be nice to mention it in the next ed. of the book, next to the mysql migrate issues. Thanks to both of you. Now if I could only figure out how to set web2py command line parameters when using apache/mod_wsgi... Eric On Aug 25, 3:03 pm, Richard Vézina <ml.richard.vez...@gmail.com> wrote: > Hello Eric, > > I would help, but I have no clue... > > Do you alternate between SQLite and Postgres? If yes, web2py always try to > recreate the auth(s) tables that is a problem I often have... To solve it > you must define the auth(s) tables in the db.py and set them to > migrate=false... so web2py stop to trigger their creation each time... > > Richard > > On Thu, Aug 25, 2011 at 1:53 PM, Eric Scott <erictransla...@gmail.com>wrote: > > > > > > > > > I'm using postgresql. I had to change a field name in my table def, > > which are in the web2py models. The database changed accordingly, but > > now I get a key error when I try to insert a new record using > > appadmin. I made sure appadmin.py is the latest and greatest. Still > > getting key error. I don't dare drop the db since each time I've done > > that before I've not been able to get it running again, no matter how > > many variations of migrate and fake_migrate I tried. So end up having > > to re-create the app, and then copy in the files, which takes a long > > time. > > > I love web2py but database issues are driving me nuts. Can someone > > please help me? My app is so close to finished. > > > Here's the traceback > > > Traceback (most recent call last): > > File "/home/www-data/web2py/gluon/restricted.py", line 192, in > > restricted > > exec ccode in environment > > File "/home/www-data/web2py/applications/baristacode/controllers/ > > appadmin.py", line 411, in <module> > > File "/home/www-data/web2py/gluon/globals.py", line 145, in <lambda> > > self._caller = lambda f: f() > > File "/home/www-data/web2py/applications/baristacode/controllers/ > > appadmin.py", line 126, in insert > > form = SQLFORM(db[table], ignore_rw=ignore_rw) > > File "/home/www-data/web2py/gluon/sqlhtml.py", line 830, in __init__ > > inp = self.widgets.options.widget(field, default) > > File "/home/www-data/web2py/gluon/sqlhtml.py", line 218, in widget > > options = requires[0].options() > > File "/home/www-data/web2py/gluon/validators.py", line 438, in > > options > > self.build_set() > > File "/home/www-data/web2py/gluon/validators.py", line 421, in > > build_set > > fields = [self.dbset.db[self.ktable][k] for k in self.fields] > > File "/home/www-data/web2py/gluon/dal.py", line 4675, in __getitem__ > > return dict.__getitem__(self, str(key)) > > KeyError: 'name_string' > > > By the way, I changed the field name from "name_string" to "name". > > Somewhere, "name_string" is still cached. I just can't figure out > > where. I've cleared the caches, restarted, etc etc. > > > Thanks in advance for your help. > > > Eric