db.models.Options.get_latest_by

Options.get_latest_by

The name of an orderable field in the model, typically a DateField, DateTimeField, or IntegerField. This specifies the default field to use in your model Manager’s latest() and earliest() methods.

Example:

get_latest_by = "order_date"

See the latest() docs for more.

doc_Django
2016-10-09 18:35:58
Comments
Leave a Comment

Please login to continue.