def create_settings_from_fixture(fixture):
 created_settings = {}
 for settingsgroup in fixture:
  group = SettingsGroup(key=settingsgroup[0], name=settingsgroup[1][u'name'], description=settingsgroup[1][u'description'])
  group.save()
  created_settings[group] = []
  for settings in settingsgroup[1][u'settings']:
   setting = Setting(key=settings[0], value=settings[1][u'value'], value_type=settings[1][u'value_type'], name=settings[1][u'name'], description=settings[1][u'description'], extra=settings[1].get(u'extra', u''), settingsgroup=group.key)
   if setting:
    setting.save()
    created_settings[group].append(setting)
 return created_settings

def create_settings_from_fixture ( fixture ) : created_settings = { } for settingsgroup in fixture : group = SettingsGroup ( key = settingsgroup [ 0 ] , name = settingsgroup [ 1 ] [ u'name' ] , description = settingsgroup [ 1 ] [ u'description' ] ) group . save ( ) created_settings [ group ] = [ ] for settings in settingsgroup [ 1 ] [ u'settings' ] : setting = Setting ( key = settings [ 0 ] , value = settings [ 1 ] [ u'value' ] , value_type = settings [ 1 ] [ u'value_type' ] , name = settings [ 1 ] [ u'name' ] , description = settings [ 1 ] [ u'description' ] , extra = settings [ 1 ] . get ( u'extra' , u'' ) , settingsgroup = group . key ) if setting : setting . save ( ) created_settings [ group ] . append ( setting ) return created_settings
inserts the settings from a fixture into the database .