Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #6
0
 def get_cclinumber_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.ccli_number), song.sort_key)
Exemple #7
0
 def get_theme_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.theme_name), song.sort_key)
Exemple #8
0
 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]))
Exemple #9
0
 def get_cclinumber_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.ccli_number), song.sort_key)
Exemple #10
0
 def get_theme_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.theme_name), song.sort_key)
Exemple #11
0
 def get_topic_key(topic):
     """Get the key to sort by"""
     return get_natural_key(topic.name)
Exemple #12
0
 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]))
Exemple #13
0
 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)