How many model files do you have and what is in them? Did you inadvertently 
redefine the "db" object in a subsequent model file (that will remove any 
previously defined models)?

Anthony

On Wednesday, February 5, 2014 3:35:29 PM UTC-5, Austin Taylor wrote:
>
> Hi Anthony,
>
> I created the db1.py (using scripts/extract_mysql_models.py) and placed 
> that in the app/models folder. Should I have done something else?
>
>
> On Wednesday, February 5, 2014 2:53:40 PM UTC-5, Anthony wrote:
>>
>> When you do "for x in db", that will iterate of the Table objects 
>> attached to db. The Table objects are just models defined in your model 
>> files -- they do not necessarily have to correspond to actual tables in 
>> your database. The tables you listed are Auth tables that would be defined 
>> via auth.define_tables(). If you have migrations turned off (or the 
>> database is not writable), then defining those tables in the model will not 
>> result in them actually being created in the database.
>>
>> Regarding the existing tables in the database, do you have models in your 
>> app defining them?
>>
>> Anthony
>>
>> On Wednesday, February 5, 2014 2:29:16 PM UTC-5, Austin Taylor wrote:
>>>
>>> Hello,
>>>
>>> I followed the instructions for importing legacy databases and created a 
>>> db1.py which gave me a nice model, but I'd like to be able to interact with 
>>> my current database. 
>>>
>>> When I type db the shell returns <DAL uri="mysql://*****:********@
>>> 127.0.0.1/tablename">
>>>
>>> I run for x in db:
>>>            print x
>>>
>>> and it only shows user, user_group, user_membership, auth_event, and 
>>> auth_cas when I access my database from phpmyadmin I don't even have those 
>>> tables in the database.
>>>
>>> Am I doing something wrong?
>>>
>>

-- 
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/groups/opt_out.

Reply via email to