@classmethod<EOL><INDENT>def read_prefs(cls, mem_prefs):<DEDENT>
db_prefs = {<EOL>'<STR_LIT>' % (pref['<STR_LIT>'], pref['<STR_LIT:name>']): pref for pref in<EOL>cls.objects.values().order_by('<STR_LIT>', '<STR_LIT:name>')<EOL>}<EOL>new_prefs = []<EOL>for app, prefs in mem_prefs.items():<EOL><INDENT>for pref_name, pref_proxy in prefs.items():<EOL><INDENT>if not pref_proxy.static:  <EOL><INDENT>key = '<STR_LIT>' % (app, pref_name)<EOL>if key in db_prefs:<EOL><INDENT>pref_proxy.db_value = db_prefs[key]['<STR_LIT:text>']<EOL><DEDENT>else:<EOL><INDENT>new_prefs.append(cls(app=app, name=pref_name, text=pref_proxy.default))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if new_prefs:<EOL><INDENT>try:<EOL><INDENT>cls.objects.bulk_create(new_prefs)<EOL><DEDENT>except IntegrityError:  <EOL><INDENT>pass<EOL><DEDENT><DEDENT>
Initializes preferences entries in DB according to currently discovered prefs.

        :param dict mem_prefs: