Fix search order

This commit is contained in:
Tim Bentley 2011-05-19 05:48:10 +01:00
parent cff081066f
commit 0c2196339a

View File

@ -235,13 +235,13 @@ class CustomMediaItem(MediaManagerItem):
log.debug(u'Titles Search') log.debug(u'Titles Search')
search_results = self.parent.manager.get_all_objects(CustomSlide, search_results = self.parent.manager.get_all_objects(CustomSlide,
CustomSlide.title.like(u'%' + self.whitespace.sub(u' ', CustomSlide.title.like(u'%' + self.whitespace.sub(u' ',
search_keywords) + u'%')) search_keywords) + u'%'), order_by_ref=CustomSlide.title)
self.loadList(search_results) self.loadList(search_results)
elif search_type == CustomSearch.Themes: elif search_type == CustomSearch.Themes:
log.debug(u'Theme Search') log.debug(u'Theme Search')
search_results = self.parent.manager.get_all_objects(CustomSlide, search_results = self.parent.manager.get_all_objects(CustomSlide,
CustomSlide.theme_name.like(u'%' + self.whitespace.sub(u' ', CustomSlide.theme_name.like(u'%' + self.whitespace.sub(u' ',
search_keywords) + u'%')) search_keywords) + u'%'), order_by_ref=CustomSlide.title)
self.loadList(search_results) self.loadList(search_results)
self.check_search_result() self.check_search_result()