pycharm inspectdb 问题
来源:4-5 自定义userprofile
qq_青椒肉丝_2
2017-03-18
老师按照你的提示 直接用inspectdb > models.py ,我使用了,但是报错。
manage.py@jkTax > inspectdb dj_nsrxx > models.py "C:\Program Files (x86)\JetBrains\PyCharm 2016.3.2\bin\runnerw.exe" D:\mxonline\mx\Scripts\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2016.3.2\helpers\pycharm\django_manage.py" inspectdb dj_nsrxx > models.py D:/jkTax # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey has `on_delete` set to the desired behavior. # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free to rename the models, but don't rename db_table values or field names. from __future__ import unicode_literals from django.db import models class DjNsrxx(models.Model): id = models.AutoField(db_column='Id', primary_key=True) # Field name made lowercase. nsrsbh = models.CharField(db_column='NSRSBH', max_length=20, blank=True, null=True) # Field name made lowercase. nsrmc = models.CharField(db_column='NSRMC', max_length=255, blank=True, null=True) # Field name made lowercase. djzclx_dm = models.CharField(db_column='DJZCLX_DM', max_length=3, blank=True, null=True) # Field name made lowercase. nsrzt_dm = models.CharField(db_column='NSRZT_DM', max_length=2, blank=True, null=True) # Field name made lowercase. hy_dm = models.CharField(db_column='HY_DM', max_length=4, blank=True, null=True) # Field name made lowercase. jdxz_dm = models.CharField(db_column='JDXZ_DM', max_length=9, blank=True, null=True) # Field name made lowercase. zgswj_dm = models.CharField(db_column='ZGSWJ_DM', max_length=11, blank=True, null=True) # Field name made lowercase. zgswskfj_dm = models.CharField(db_column='ZGSWSKFJ_DM', max_length=11, blank=True, null=True) # Field name made lowercase. class Meta: managed = False db_table = 'dj_nsrxx' D:\mxonline\mx\lib\site-packages\django\db\backends\mysql\base.py:110: Warning: (1017L, u"Can't find file: '.\\king3\\@003e.frm' (errno: 22)") return self.cursor.execute(query, args) # Unable to inspect table '>' # The error was: (1017, "Can't find file: '.\\king3\\@003e.frm' (errno: 22)") # Unable to inspect table 'models.py' # The error was: (1146, "Table 'king3.models.py' doesn't exist") Process finished with exit code 0
写回答
1回答
-
bobby
2017-03-20
The error was: (1146, "Table 'king3.models.py' doesn't exist") 这里报错是kings3.models 表不存在 你可以先试试建一个简单的库 然后测试一下这个命令 然后再回去排查你的数据库的问题
00
相似问题