django date filter gte and lte

前端 未结 2 1858
-上瘾入骨i
-上瘾入骨i 2020-12-29 06:25

I need to find data within a certain set of parameters I am building a small booking system, that lets user see what vehicles are available for booking for their little safa

2条回答
  •  抹茶落季
    2020-12-29 07:03

    Can you try this :

    order = Order.objects.filter(pick_up**__date__**lte=pickup).filter(drop_off**__date__**gte=dropoff)
    

    https://docs.djangoproject.com/fr/2.0/ref/models/querysets/#date

提交回复
热议问题