def init_on_load(self): """ Precompute a natural sorting, locale aware sorting key. Song sorting is performance sensitive operation. To get maximum speed lets precompute the sorting key. """ self.sort_key = get_natural_key(self.title)
def init_on_load(self): """ Precompute a natural sorting, locale aware sorting key. Song sorting is performance sensitive operation. To get maximum speed lets precompute the sorting key. """ self.sort_key = get_natural_key(self.title)
def get_book_key(book): """Get the key to sort by""" return get_natural_key(book.name)
def get_topic_key(topic): """Get the key to sort by""" return get_natural_key(topic.name)
def get_author_key(author): """Get the key to sort by""" return get_natural_key(author.display_name)
def get_cclinumber_key(song): """Get the key to sort by""" return (get_natural_key(song.ccli_number), song.sort_key)
def get_theme_key(song): """Get the key to sort by""" return (get_natural_key(song.theme_name), song.sort_key)
def get_songbook_key(result): """Get the key to sort by""" return (get_natural_key(result[1]), get_natural_key(result[0]), get_natural_key(result[2]))
def get_cclinumber_key(song): """Get the key to sort by""" return (get_natural_key(song.ccli_number), song.sort_key)
def get_theme_key(song): """Get the key to sort by""" return (get_natural_key(song.theme_name), song.sort_key)
def get_topic_key(topic): """Get the key to sort by""" return get_natural_key(topic.name)
def get_songbook_key(result): """Get the key to sort by""" return (get_natural_key(result[1]), get_natural_key(result[0]), get_natural_key(result[2]))
def get_author_key(author): """Get the key to sort by""" return get_natural_key(author.display_name)
def get_book_key(book): """Get the key to sort by""" return get_natural_key(book.name)