<commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

from srd20.models import Spell

class Migration(DataMigration):

    def forwards(self, orm):
        for s in orm.Spell.objects.exclude(wizard_focus=''):
            assert s.wizard_focus == s.sorcerer_focus
            assert s.wizard_focus == s.bard_focus
            s.arcane_focus = s.wizard_focus
            s.wizard_focus = ''
            s.sorcerer_focus = ''
            s.bard_focus = ''
            s.save()
        assert not Spell.objects.exclude(wizard_focus='')
        assert not Spell.objects.exclude(sorcerer_focus='')
        assert not Spell.objects.exclude(bard_focus='')

    def backwards(self, orm):
        pass 
        # This could copy the arcane field to wizard/sorcerer/bard _focus
        # on the scrying spells. But I can't find the reason to revert this
        # migration


    models = {
        'srd20.spell': {
            'Meta': {'ordering': "('name',)", 'object_name': 'Spell', 'db_table': "'spell'"},
            'altname': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
            'arcane_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'arcane_material_components': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'area': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'bard_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'casting_time': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
            'cleric_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'components': ('django.db.models.fields.TextField', [], {}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'descriptor': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}),
            'druid_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'duration': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'effect': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'focus': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'full_text': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'level': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}),
            'material_components': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),<commit_msg>Missing update to also use orm.xxx<commit_after># encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

from srd20.models import Spell

class Migration(DataMigration):

    def forwards(self, orm):
        for s in orm.Spell.objects.exclude(wizard_focus=''):
            assert s.wizard_focus == s.sorcerer_focus
            assert s.wizard_focus == s.bard_focus
            s.arcane_focus = s.wizard_focus
            s.wizard_focus = ''
            s.sorcerer_focus = ''
            s.bard_focus = ''
            s.save()
        assert not orm.Spell.objects.exclude(wizard_focus='')
        assert not orm.Spell.objects.exclude(sorcerer_focus='')
        assert not orm.Spell.objects.exclude(bard_focus='')

    def backwards(self, orm):
        pass 
        # This could copy the arcane field to wizard/sorcerer/bard _focus
        # on the scrying spells. But I can't find the reason to revert this
        # migration


    models = {
        'srd20.spell': {
            'Meta': {'ordering': "('name',)", 'object_name': 'Spell', 'db_table': "'spell'"},
            'altname': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
            'arcane_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'arcane_material_components': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'area': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'bard_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'casting_time': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
            'cleric_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'components': ('django.db.models.fields.TextField', [], {}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'descriptor': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}),
            'druid_focus': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'duration': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'effect': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
            'focus': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'full_text': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'level': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}),
            'material_components': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
{'fraction_non_alphanumeric': 0.2045723962743438, 'fraction_numerical': 0.01388653683319221, 'mean_word_length': 3.0122282608695654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '124112', 'n_tokens_mistral': 1887, 'n_tokens_neox': 1809, 'n_words': 358}