sort searched queries by creation time, assuming the newer queries are usually more relevant

This commit is contained in:
Joey Simhon 2015-01-17 21:14:56 +02:00
parent e85d3c3c9f
commit 4e8888ce2f

View File

@ -358,7 +358,7 @@ class Query(BaseModel):
if term.isdigit():
where |= cls.id == term
return cls.select().where(where)
return cls.select().where(where).order_by(cls.created_at.desc())
@classmethod
def update_instance(cls, query_id, **kwargs):