使用方法非常简单:
在项目目录下的命令行中输入:
python manage.py inspectdb
或
python manage.py inspectdb > models.py
自动产生models.py文件:
python 代码
- class DjangoAdminLog(models.Model):
- id = models.IntegerField(primary_key=True)
- action_time = models.DateTimeField()
- user_id = models.IntegerField()
- content_type_id = models.IntegerField(null=True, blank=True)
- object_id = models.TextField(blank=True)
- object_repr = models.CharField(maxlength=200)
- action_flag = models.TextField() # This field type is a guess.
- change_message = models.TextField()
- class Meta:
- db_table = 'django_admin_log'
No comments:
Post a Comment