2011-01-20 67 views

回答

4

不,模型不知道。您需要直接查詢數據庫:

>>> from django.db import connection 
>>> cursor = connection.cursor() 
>>> cursor.execute("SHOW TABLE STATUS WHERE name='appname_modelname'") 
>>> print cursor.fetchone() 

('appname_modelname', 
u'InnoDB', 
10L, 
u'Compact', 
29L, 
6779L, 
196608L, 
0L, 
49152L, 
10485760L, 
34L, 
datetime.datetime(2010, 11, 19, 13, 5), 
None, 
None, 
u'latin1_swedish_ci', 
None, 
u'', 
u'')