打印日期范围,如果它们在db中可用

时间:2017-12-27 07:24:52

标签: python django django-models django-views xlwt

从下面的代码我打算打印日期范围很好,但问题是我需要打印日期范围,仅在数据库中可用[this image shows the created_at date field which is in look model . I need these dated to be printed if user select the date rage between dec 1 to dec 30 ] 1

while (current_date >= from_date):
     r = r + 1
     ws.write(0,r,current_date,style)
     current_date -= timedelta(days = 1)

models.py

class Look(models.Model):
     created_at = models.DateField()

0 个答案:

没有答案