通过迁移(南)设置 django 通知类型?
在教程中(到处都是,因为没有官方教程),建议在各种位置放置 django-notification 的 notification.create_notice_type
,但最合乎逻辑的地方不是在迁移?或者有充分的理由不这样做吗?
由于这似乎是一个如此明显的解决方案,我有点惊讶它没有在任何地方(我可以找到它)建议,因此担心我可能会错过一些技术细节。
In tutorials (all over the place, since there is no official one), all kinds of places get suggested for placing notification.create_notice_type
of django-notification, but wouldn't the most logical place be in a migration? Or is there a good reason not to do that?
Since it seems like such an obvious solution I'm a bit suprrised that it's nowhere (where I could find it) suggested, and therefore am afraid I might be missing a technicality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想到的一个反对意见是在初始部署的情况下,例如新开发人员加入您的团队。
处理此问题的最常见方法是运行syncdb --all,然后伪造现有迁移。在这种情况下,您的通知类型将不会被创建。
One objection that comes to mind is in the case of initial deployments, e.g. a new developer joins your team.
The most common way this is handled is to run syncdb --all and then fake the existing migrations. In cases like that, your notice type would not be created.