Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 django 模型中存储年份(YYYY)的最佳方式是什么?我正在使用 mysql 后端。
start_year = models.SmallIntegerField(blank=True, null=True)
??
再想一想,既然你要存储年数,那就让它成为非负数。
start_year = models.PositiveSmallIntegerField(blank=True, null=True)