auto_import scans the table files for tables. That's the whole point of not redefining models (because they are stored in table files that can be read). Normal behaviour is: DAL(..., migrate=True) let it define tables, then DAL(, migrate=False) #or migrate_enabled=False so table files are never touched again, and can be imported. PS: big_id isn't saved into table definitions, so you must specify that parameter also outside (and it's safe I guess turning migrations off also for external access).
To solve your problem, try one round of DAL(..,migrate_enabled=False, fake_migrate_all=True) fake_migrate_all will fake all table creations and generates the relative .table files (of course you must be sure that your table definitions are synced with your db structure) >From then on, you should be able to import them DAL(...,migrate_enabled=False, big_id=True, auto_import=True, folder='...') On Tuesday, October 23, 2012 11:08:04 PM UTC+2, Jim S wrote: > > It is empty. > > On Tue, Oct 23, 2012 at 4:01 PM, Niphlod <[email protected] > <javascript:>>wrote: > >> is your databases folder filled with the .table files relative to the >> tables ? >> >> >> On Tuesday, October 23, 2012 10:57:04 PM UTC+2, Jim S wrote: >>> >>> Hi - I use MySQL for my database. In my production environment I'm >>> specifying the following: >>> >>> db = DAL(infoCenterUtil.getDalString(), migrate=False, >>> migrate_enabled=False, bigint_id=True) >>> >>> On my production machine I'm also trying to use the DAL outside of >>> web2py with the following: >>> >>> import sys >>> sys.path.append('c:/prod/web2py') >>> from gluon import DAL, Field >>> db = DAL('mysql://username:password@server/database',folder= >>> 'c:/prod/web2py/applications/InfoCenter/databases', auto_import=True) >>> >>> print db.tables >>> >>> But, I get an empty list when I print db.tables. On my test machine >>> where all of my auto-migrations happen, it works fine. >>> >>> Am I barking up the wrong tree in thinking that migration has something >>> to do with my problem (print db.tables give empty list). If not, what am I >>> doing wrong? I don't want auto-migrations on my production box. What is >>> the proper way to have no migration on a machine, but allow for DAL outside >>> of web2py? >>> >>> -Jim >>> >> -- >> >> >> >> > > --

