MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / latest

Method latest

haystack/query.py:530–535  ·  view source on GitHub ↗

Returns the most recent search result that matches the query.

(self, date_field)

Source from the content-addressed store, hash-verified

528 return self[0]
529
530 def latest(self, date_field):
531 """Returns the most recent search result that matches the query."""
532 clone = self._clone()
533 clone.query.clear_order_by()
534 clone.query.add_order_by("-%s" % date_field)
535 return clone.best_match()
536
537 def more_like_this(self, model_instance):
538 """Finds similar results to the object passed in."""

Callers 2

test_latestMethod · 0.45
test_latestMethod · 0.45

Calls 4

_cloneMethod · 0.95
clear_order_byMethod · 0.80
add_order_byMethod · 0.80
best_matchMethod · 0.45

Tested by 2

test_latestMethod · 0.36
test_latestMethod · 0.36