I’m trying to write a Django query for widgets that are more than 5 hours old and I’m a bit lost. The widget model has a DateTimeField that is populated with the creation time of the widget.
I’m trying to write a Django query for widgets that are more than 5
Share
If
Widgetis the name of your model, and it has a DateTimeField attribute namedcreated, the query would be:Note that
created__ltmeans “created is less than”.