打开sqlite命令行

python manage.py dbshell

退出

.quit

  1. from django.db import models
  2. # Create your models here.
  3. class Asset(models.Model):
  4. name = models.CharField(max_length=255, verbose_name="资产名称")
  5. staff = models.CharField(max_length=255, verbose_name="员工")
  6. section = models.CharField(max_length=255, verbose_name="所属部门")
  7. date = models.DateTimeField(verbose_name="日期")
  8. value = models.FloatField(verbose_name="价值")
  9. count = models.IntegerField(verbose_name="数量")
  10. condition = models.IntegerField(verbose_name="使用情况")
  11. class Meta:
  12. managed = True
  13. db_table = 'asset'
  14. verbose_name = '固定资产管理'
  15. class User(models.Model):
  16. staff = models.CharField(max_length=255, verbose_name="员工姓名")
  17. section = models.CharField(max_length=255, verbose_name="所属部门")
  18. account = models.CharField(max_length=11, verbose_name="账号")
  19. password = models.CharField(max_length=255, verbose_name="密码")
  20. class Meta:
  21. managed = True
  22. db_table = 'user'
  23. verbose_name = '用户信息管理'