【发布时间】:2017-03-29 07:17:42
【问题描述】:
我正在使用pyyaml。
我正在使用以下命令在 django 项目中创建固定装置:
python manage.py dumpdata app.ModelName --format=yaml > fixtures/dev/fixture_name.yaml
我得到的输出是:
- fields: {active: true, created_at: !!timestamp '2016-11-14 10:43:40.221602', age: 54,
updated_at: !!timestamp '2016-11-14 10:43:40.221603', user_type: 1}
model: app.ModelName
pk: 1
我想要的是:
- fields:
created_at: 2016-11-14 10:43:40.220895
age: 54
user_type: 1
updated_at: 2016-11-14 10:43:40.220900
model: app.ModelName
pk: 1
我怎样才能做到这一点?
【问题讨论】:
-
manage.py的来源在哪里?