Commits

Frank Becker committed fe4d858

added introspection rule, triggers same problem

Comments (0)

Files changed (4)

mainapp/migrations/0001_initial.py

+# -*- coding: 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):
+        # Adding model 'MainModel'
+        db.create_table('mainapp_mainmodel', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('sub', self.gf('subapp.fields.SubField')()),
+        ))
+        db.send_create_signal('mainapp', ['MainModel'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'MainModel'
+        db.delete_table('mainapp_mainmodel')
+
+
+    models = {
+        'mainapp.mainmodel': {
+            'Meta': {'object_name': 'MainModel'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'sub': ('subapp.fields.SubField', [], {})
+        },
+        'subapp.submodel': {
+            'Meta': {'object_name': 'SubModel'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+        }
+    }
+
+    complete_apps = ['mainapp']

mainapp/migrations/__init__.pyc

Binary file modified.
 # -*- coding: utf-8 -*-
 from django.db import models
 from subapp.fields import SubField
+from subapp.models import SubModel
 
 # South introspection rules
 from south.modelsinspector import add_introspection_rules
 
-licence_introspection_rule = (
-    (LicenseField,),
+subfield_introspection_rule = (
+    (SubField,),
     [],
         {
-        'to': ['rel.to', {'default': License}],
-        #'to': ('rel.to',  {'default': 'licenses.License'}),
-        #"to_field": ["rel.field_name", {"default_attr": "rel.to._meta.pk.name"}],
-        #'required': ['required', {'default': False}],
-        #'null': ['null', {'default': False}],
-        #'blank': ['blank', {'default': False}],
-        #'related_name': ['rel.related_name', {"default": "Hallo"}],
-        #"db_index": ["db_index", {"default": True}],
+        'to': ['rel.to', {'default': SubModel}],
         },
     )
 
 add_introspection_rules(
-    [licence_introspection_rule], ["^licenses\.fields\.LicenseField"])
+    [subfield_introspection_rule], ["^subapp\.fields\.SubField"])
+
 
 class MainModel(models.Model):
     """The one and only model"""

project/data.db

Binary file modified.