#NEWLINE# def load_from_db( self ) : #NEWLINE# #INDENT# 'Return a dictionary of preferences by section directly from DB' #NEWLINE# a = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# db_prefs = { p . preference . identifier ( ) : p for p in db_prefs . queryset } #NEWLINE# for preference in self . registry . preferences ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# db_pref = db_prefs [ preference . identifier ( ) ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# db_pref = self . create_db_pref ( section = preference . section . name , name = preference . name , value = preference . default ) #NEWLINE# #UNINDENT# self . to_cache ( db_pref ) #NEWLINE# a [ preference . identifier ( ) ] = self . from_cache ( preference . section . name , preference . name ) #NEWLINE# #UNINDENT# return a