Django bool filter not repeating

I want to filter out all related objects in which (relation = next relation in the virtual community) the date on which the next was initiated, in the past, related to the moment now.

The following declaration seems incorrect because the bool object is not iterable. Is there any other way to do this?

d = Relations.objects.filter(date_follow < datetime.now())
+3
source share
2 answers

In the documents .

d = Relations.objects.filter(date_follow__lt=datetime.now())
+6
source

Try the following:

d = Relations.objects.filter(date_follow__lt=datetime.now())

Relevant documentation here:
http://docs.djangoproject.com/en/dev/ref/models/querysets/#id7

+1
source

Source: https://habr.com/ru/post/1749751/


All Articles