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-postmanに基づいてインストールおよび構成しました。
django-postman
全て大丈夫。テンプレートで認証されたユーザーのメッセージ リスト (未読メッセージと削除されていないメッセージのリスト) を取得したいのですが、これはそれを完全に (受信トレイ、ゴミ箱、送信済み、受信済みメッセージで) 表示する受信トレイ ビューのように思えますが、メッセージリストが必要です。何か案は?
これが私の解決策です:
でviews.py:
views.py
unread_messages=request.user.received_messages.filter(read_at__isnull=True,sender_deleted_at__isnull=True)
でtemplate:
template
{% for m in unread_messages %} <!--do stuff--> {% endfor %}