Source

django-admin-tools / admin_tools / menu / migrations / 0001_initial.py

Diff from to

admin_tools/menu/migrations/0001_initial.py

 from south.db import db
 from south.v2 import SchemaMigration
 from django.db import models
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
+user_model = '%s.%s' % (User._meta.app_label, User._meta.object_name)
 
 class Migration(SchemaMigration):
 
         # Adding model 'Bookmark'
         db.create_table('admin_tools_menu_bookmark', (
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
-            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm[user_model])),
             ('url', self.gf('django.db.models.fields.CharField')(max_length=255)),
             ('title', self.gf('django.db.models.fields.CharField')(max_length=255)),
         ))
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
             'url': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
-            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['%s']" % user_model})
         }
     }