onetoonefield in usercard & migrations
authorJan Szejko <janek37@gmail.com>
Thu, 19 Jan 2017 12:23:02 +0000 (13:23 +0100)
committerJan Szejko <janek37@gmail.com>
Thu, 19 Jan 2017 12:23:02 +0000 (13:23 +0100)
apps/catalogue/migrations/0010_auto_20170119_1321.py [new file with mode: 0644]
apps/organizations/migrations/0009_auto_20170119_1321.py [new file with mode: 0644]
apps/organizations/models.py

diff --git a/apps/catalogue/migrations/0010_auto_20170119_1321.py b/apps/catalogue/migrations/0010_auto_20170119_1321.py
new file mode 100644 (file)
index 0000000..b672172
--- /dev/null
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('catalogue', '0009_auto_20161130_1346'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='publishrecord',
+            options={'ordering': ['-timestamp'], 'verbose_name': 'book publish record', 'verbose_name_plural': 'book publish records'},
+        ),
+        migrations.AlterField(
+            model_name='document',
+            name='tags',
+            field=models.ManyToManyField(to='catalogue.Tag', blank=True),
+        ),
+    ]
diff --git a/apps/organizations/migrations/0009_auto_20170119_1321.py b/apps/organizations/migrations/0009_auto_20170119_1321.py
new file mode 100644 (file)
index 0000000..7bef8cb
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+from django.conf import settings
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organizations', '0008_organization_tags'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='organization',
+            name='tags',
+            field=models.ManyToManyField(to='catalogue.Tag', blank=True),
+        ),
+        migrations.AlterField(
+            model_name='usercard',
+            name='user',
+            field=models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL),
+        ),
+    ]
index 6b1d918..c236da4 100644 (file)
@@ -90,7 +90,7 @@ class Card(models.Model):
 @python_2_unicode_compatible
 class UserCard(Card):
     preview_html_template = 'organizations/snippets/user.html'
-    user = models.ForeignKey(User, unique=True, primary_key=True)
+    user = models.OneToOneField(User, primary_key=True)
 
     def __str__(self):
         return str(self.user)