<s> """<STR_LIT>""" <EOL> from django . db import models <EOL> class SettingsCategory ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class Setting ( models . Model ) : <EOL> name = models . TextField ( max_length = <NUM_LIT:30> ) <EOL> content = models . TextField ( max_length = <NUM_LIT> , blank = True ) <EOL> date_modified = models . DateTimeField ( '<STR_LIT>' , auto_now = True ) <EOL> category = models . ForeignKey ( SettingsCategory ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> @ classmethod <EOL> def as_dict ( cls ) : <EOL> all_settings = cls . objects . all ( ) <EOL> settings_dict = dict ( ) <EOL> for setting in all_settings : <EOL> code_name = setting . name . lower ( ) . replace ( '<STR_LIT:U+0020>' , '<STR_LIT:_>' ) <EOL> settings_dict [ code_name ] = setting . content <EOL> return settings_dict </s>
