【发布时间】:2012-04-29 00:23:30
【问题描述】:
大家好 Djangonauts:
我使用 django-lint 检查了我的项目,结果如下:
W:211,16:MyModel: timestamp: Uses superceded auto_now or auto_now_add
auto_now/auto_now_add not technically deprecated, but they still suck.
为什么他们说 auto_now/auto_now_add “糟透了”?使用这两个字段参数实现 created/last-updated 模式没有问题。
这种模式有更好的方法吗?自定义字段类?为什么(如果这种方法更好)它没有被集成到 Django 中?
【问题讨论】:
标签: python django datetime last-modified pylint