如何使用用于创建相关对象的表单创建通用 DetailView
我想要一个博客文章的 DetailView,以及一个可用于创建相关评论的表单。
我想要 CreateView 的功能依赖于 Comment 模型,而 DetailView 的功能依赖于 Blog 模型
I want a DetailView for a blog post, with a form that can be used to create related comments.
I want the features of a CreateView dependent on the Comment model and DetailView dependent on the Blog model
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用 Django 评论应用程序吗?如果是这样,请使用博客模型的详细视图,并使用模板标签包含评论。
Are you using the Django comments app? If so, use a detail view for the blog model and include the comments using the template tag.