Commits

Luke Plant committed a8449b3

Migration and code to deal with a change in the way South deals with custom fields.

Comments (0)

Files changed (3)

semanticeditor/fields.py

         for v in value:
             if v not in choice_keys:
                 raise exceptions.ValidationError(self.error_messages['invalid_choice'] % value)
+
+
+from south.modelsinspector import add_introspection_rules
+add_introspection_rules([], ["^semanticeditor\.fields\.MultiSelectField"])

semanticeditor/migrations/0002_cssclass_template.py

             'description': ('django.db.models.fields.TextField', [], {'max_length': '255', 'blank': 'True'}),
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True'}),
-            'templates': ('MultiSelectField', ['"Templates"'], {'default': "''", 'blank': 'True'}),
+            'templates': ('semanticeditor.fields.MultiSelectField', ['"Templates"'], {'default': "''", 'blank': 'True'}),
             'verbose_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True'})
         }
     }

semanticeditor/migrations/0003_auto__chg_field_cssclass_templates.py

+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        # This appears to be necessary due to a change in introspection of
+        # custom fields by South.
+
+        # Changing field 'CssClass.templates'
+        db.alter_column('semanticeditor_cssclass', 'templates', self.gf('semanticeditor.fields.MultiSelectField')())
+
+
+    def backwards(self, orm):
+        
+        # Changing field 'CssClass.templates'
+        db.alter_column('semanticeditor_cssclass', 'templates', self.gf('semanticeditor.fields.MultiSelectField')("Templates"))
+
+
+    models = {
+        'semanticeditor.cssclass': {
+            'Meta': {'ordering': "('verbose_name',)", 'object_name': 'CssClass'},
+            'allowed_elements': ('django.db.models.fields.CharField', [], {'default': "'h1 h2 h3 h4 h5 h6 p blockquote ul ol li newrow newcol'", 'max_length': '255'}),
+            'column_equiv': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'description': ('django.db.models.fields.TextField', [], {'max_length': '255', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+            'templates': ('semanticeditor.fields.MultiSelectField', [], {'default': "''", 'blank': 'True'}),
+            'verbose_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
+        }
+    }
+
+    complete_apps = ['semanticeditor']
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.