This topic created in 4224 days ago, the information mentioned may be changed or developed.
比如说现在想增加一个评论,评论是存在另外一个表里,在展示Product的详情页的时候,想把这个商品的评论都展示出来,我想最好的办法就是给Product增加方法,或者是扩展action?
2 replies • 2015-04-11 18:48:41 +08:00
 |
|
评论(comment)模型(model)加个ForeignKey 连到Product comment = models.ForeignKey("Product")
然后 product.comment_set.all()就是所有的评论queryset
|