def delete_settings_from_fixture(fixture):
 deleted_settings = {}
 for settingsgroup in fixture:
  group = SettingsGroup.query.filter_by(key=settingsgroup[0]).first()
  deleted_settings[group] = []
  for settings in settingsgroup[1][u'settings']:
   setting = Setting.query.filter_by(key=settings[0]).first()
   if setting:
    deleted_settings[group].append(setting)
    setting.delete()
  group.delete()
 return deleted_settings

def delete_settings_from_fixture ( fixture ) : deleted_settings = { } for settingsgroup in fixture : group = SettingsGroup . query . filter_by ( key = settingsgroup [ 0 ] ) . first ( ) deleted_settings [ group ] = [ ] for settings in settingsgroup [ 1 ] [ u'settings' ] : setting = Setting . query . filter_by ( key = settings [ 0 ] ) . first ( ) if setting : deleted_settings [ group ] . append ( setting ) setting . delete ( ) group . delete ( ) return deleted_settings
deletes the settings from a fixture from the database .