2

I want to filter base on time field in jsonfield,but this field store as string and i can not use this query:

Notification.objects.filter(Q(data__payload__request_visit_time__gte=timezone.now()))
Nathan
  • 449
  • 1
  • 7
  • 23
arezoo
  • 328
  • 3
  • 14

1 Answers1

4

By comments of this post it seems to be possible if you pass datetime value in your query as string:

Notification.objects.filter(Q(data__payload__request_visit_time__gte=timezone.now().isoformat()))
validname
  • 1,376
  • 15
  • 22