flushing the est of the material for django-1.7
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 31 Mar 2015 15:02:57 +0000 (17:02 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 31 Mar 2015 15:02:57 +0000 (17:02 +0200)
see README.django-1.7 for more details
essentially new-style migrations come in portal/native_migrations
but this requires manual setup when running under 1.7

README.django-1.7 [new file with mode: 0644]
myslice/settings.py
portal/native_migrations/0001_initial.py [new file with mode: 0644]
portal/native_migrations/__init__.py [new file with mode: 0644]

diff --git a/README.django-1.7 b/README.django-1.7
new file mode 100644 (file)
index 0000000..382c422
--- /dev/null
@@ -0,0 +1,30 @@
+Thierry Parmentelat <thierry.parmentelat@inria.fr>
+
+As of March 31 2015, the code should be mostly ready for django-1.7,
+with the following restrictions
+
+* migrations : django-1.7 comes with its own native migrations system
+  and so south is not needed/recommended any longer. So for now we have a
+  version of such native migrations that does a one-shot setup of a db
+  schema but this is stored in
+
+  portal/native_migrations
+
+  instead of the standard location
+
+  portal/migrations
+
+  because this one is still expected to hold south code with earlier djangos
+  You might need to rename native_migrations/ into migrations/ before
+  running manage.py migrate in the first place
+
+* testing quite a few issues related to 1.7 have been addressed but it
+  would be presomptuous to state that things were tested very
+  thoroughly, far from that.
+
+  So please use with care and let meknow of any additional issues
+
+
+
+  
+
index 8c3f49e..f4d0835 100644 (file)
@@ -249,8 +249,6 @@ INSTALLED_APPS = [
     'plugins',
     # views - more or less stable 
     'ui',
-    # managing database migrations
-    'south', 
     # Uncomment the next line to enable the admin:
      'django.contrib.admin',
        # FORGE Plugin app
@@ -259,8 +257,16 @@ INSTALLED_APPS = [
     # 'django.contrib.admindocs',
     'portal',
 ]
+# with django-1.7 we leave south and use native migrations
+# managing database migrations
+import django
+major, minor, _, _, _ = django.VERSION
+if major == 1 and minor <= 6:
+    INSTALLED_APPS.append('south')
+
 # this app won't load in a build environment
-if not building: INSTALLED_APPS.append ('rest')
+if not building:
+    INSTALLED_APPS.append ('rest')
 
 for component in components.list() :
     INSTALLED_APPS.append(component)
diff --git a/portal/native_migrations/0001_initial.py b/portal/native_migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..d307a59
--- /dev/null
@@ -0,0 +1,114 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Institution',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('name', models.TextField()),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.CreateModel(
+            name='PendingAuthority',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('site_name', models.TextField()),
+                ('site_authority', models.TextField()),
+                ('site_abbreviated_name', models.TextField()),
+                ('site_url', models.TextField()),
+                ('site_latitude', models.TextField()),
+                ('site_longitude', models.TextField()),
+                ('address_line1', models.TextField()),
+                ('address_line2', models.TextField()),
+                ('address_line3', models.TextField()),
+                ('address_city', models.TextField()),
+                ('address_postalcode', models.TextField()),
+                ('address_state', models.TextField()),
+                ('address_country', models.TextField()),
+                ('authority_hrn', models.TextField()),
+                ('created', models.DateTimeField(auto_now_add=True)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.CreateModel(
+            name='PendingJoin',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('user_hrn', models.TextField()),
+                ('email', models.TextField()),
+                ('project_name', models.TextField(null=True)),
+                ('authority_hrn', models.TextField()),
+                ('created', models.DateTimeField(auto_now_add=True)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.CreateModel(
+            name='PendingProject',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('project_name', models.TextField()),
+                ('user_hrn', models.TextField()),
+                ('email', models.TextField()),
+                ('authority_hrn', models.TextField(null=True)),
+                ('purpose', models.TextField(default=b'NA')),
+                ('created', models.DateTimeField(auto_now_add=True)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.CreateModel(
+            name='PendingSlice',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('slice_name', models.TextField()),
+                ('user_hrn', models.TextField()),
+                ('authority_hrn', models.TextField(null=True)),
+                ('number_of_nodes', models.TextField(default=0)),
+                ('type_of_nodes', models.TextField(default=b'NA')),
+                ('purpose', models.TextField(default=b'NA')),
+                ('created', models.DateTimeField(auto_now_add=True)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+        migrations.CreateModel(
+            name='PendingUser',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('first_name', models.TextField()),
+                ('last_name', models.TextField()),
+                ('email', models.EmailField(max_length=75)),
+                ('password', models.TextField()),
+                ('user_hrn', models.TextField()),
+                ('public_key', models.TextField()),
+                ('private_key', models.TextField()),
+                ('authority_hrn', models.TextField()),
+                ('login', models.TextField()),
+                ('pi', models.TextField()),
+                ('email_hash', models.TextField()),
+                ('status', models.TextField()),
+                ('created', models.DateTimeField(auto_now_add=True)),
+            ],
+            options={
+            },
+            bases=(models.Model,),
+        ),
+    ]
diff --git a/portal/native_migrations/__init__.py b/portal/native_migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29