Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
 def get_book_key(book):
     """Get the key to sort by"""
     return get_natural_key(book.name)
Exemplo n.º 4
0
 def get_topic_key(topic):
     """Get the key to sort by"""
     return get_natural_key(topic.name)
Exemplo n.º 5
0
 def get_author_key(author):
     """Get the key to sort by"""
     return get_natural_key(author.display_name)
Exemplo n.º 6
0
 def get_cclinumber_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.ccli_number), song.sort_key)
Exemplo n.º 7
0
 def get_theme_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.theme_name), song.sort_key)
Exemplo n.º 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]))
Exemplo n.º 9
0
 def get_cclinumber_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.ccli_number), song.sort_key)
Exemplo n.º 10
0
 def get_theme_key(song):
     """Get the key to sort by"""
     return (get_natural_key(song.theme_name), song.sort_key)
Exemplo n.º 11
0
 def get_topic_key(topic):
     """Get the key to sort by"""
     return get_natural_key(topic.name)
Exemplo n.º 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]))
Exemplo n.º 13
0
 def get_author_key(author):
     """Get the key to sort by"""
     return get_natural_key(author.display_name)
Exemplo n.º 14
0
 def get_book_key(book):
     """Get the key to sort by"""
     return get_natural_key(book.name)