Select between two dates with Django

后端 未结 4 2072
春和景丽
春和景丽 2020-12-04 13:35

I am looking to make a query that selects between dates with Django.

I know how to do this with raw SQL pretty easily, but how could this be achieved using the Djang

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 14:39

    Use the __range operator:

    ...filter(current_issue__isnull=True, created_at__range=(start_date, end_date))
    

提交回复
热议问题