self.data = [] from models.settings import Settings defaults = { 'nuts': ['pages', 'articles'], 'admins': ['Nobody <nobody@localhost>',], 'hosts': ['localhost', 'appspot.com'], 'dp_highlighter': False, 'google_analytics' : '', 'google_adsense_client' : '', 'google_adsense_slot' : '', 'google_adsense_width': 0, 'google_adsense_height': 0, 'disqus_forum' : '' } NutSettings = lambda : Settings.get_or_create('settings:hazel', **defaults) class SettingsForm(Form): nuts = CSVField('Nuts', [], u'A list of your activated modules') # FIXME: create a custom validator that does the validation of the # Name <Email>[, Name <Email>]* field. admins = CSVField('Admins', [], u'A list of people who will be notified in case of emergency') hosts = CSVField('Hosts', [], u'A comma seperated list of hosts on which to listen. In case of a unknown host, a redirect to the first item in the list will occour.') # FIXME: create validator google_analytics = TextField('Google Analytics ID', [], u'UA-xxxxxx-xx') google_adsense_client = TextField('Google AdSense Client', [], u'pub-...') google_adsense_slot = TextField('Google AdSense Slot', [], u'the slot value') google_adsense_width = IntegerField('Google AdSense Width', [], u'the width value') google_adsense_height = IntegerField('Google AdSense Height', [], u'the height value') disqus_forum = TextField('Disqus Forum ID', [], u'The name of the disqus forum to use for comments') dp_highlighter = BooleanField('Enable dp.SyntaxHighlighter')