django queryset to select max id of each distinct filed

前端 未结 0 817
慢半拍i
慢半拍i 2021-01-19 10:46

I\'m new to django, and I want to select last message of each thread: models.py

class ChatMessage(models.Model):
    thread = models.ForeignKey(\         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题