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.
posts = Post.objects.filter(author=member.user, xyz=xyz_id, pub_date >= datetime.datetime.now()-7)
過去7日間の作成者とxyzの要件によるすべての投稿を抽出したいと思います。過去7日間の結果のみ。私はこれが間違っていることをよく知っていますが、それをコーディングする方法がわかりません。
from datetime import datetime, timedelta posts = Post.objects.filter(author=member.user, xyz=xzy_id, pub_date__gte=datetime.now()-timedelta(days=7))