开发者

django datefield filter

I'd like to use an object filter similar to the following

Shipment.objects.filter(date__gte=datetime.date(2005,1,1))

However there doesn't seem to be support for compar开发者_开发知识库ison operators on datetime objects. Is there a method I'm unaware of or should I look into writing a custom filter.


I use date comparison in my code a lot and they work e.g copied a snippet from my calendar code

q.filter(start_date__gt=pay_period.start_date).order_by("start_date")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜