diff --git a/.travis.yml b/.travis.yml index 10c5e34..6badf25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ env: global: - DATABASE_URL='postgres://postgres@localhost/conman' matrix: - - DJANGO='django>=1.7,<1.8' + - DJANGO='django>=1.8,<1.9' install: - pip install python-coveralls - psql -c 'CREATE DATABASE conman' -U postgres; diff --git a/README.md b/README.md index 60a613a..12a8659 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Sponsored by [Incuna](http://incuna.com/). Tested against: - Python 3.4 -- Django 1.7 +- Django 1.8 Requires: - `django-mptt` diff --git a/conman/pages/migrations/0001_initial.py b/conman/pages/migrations/0001_initial.py new file mode 100644 index 0000000..5c21201 --- /dev/null +++ b/conman/pages/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import sirtrevor.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('routes', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Page', + fields=[ + ('route_ptr', models.OneToOneField(serialize=False, auto_created=True, parent_link=True, primary_key=True, to='routes.Route')), + ('content', sirtrevor.fields.SirTrevorField(default='')), + ], + options={ + 'ordering': ('tree_id', 'lft'), + 'abstract': False, + }, + bases=('routes.route',), + ), + ] diff --git a/conman/pages/migrations/__init__.py b/conman/pages/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conman/redirects/migrations/0001_initial.py b/conman/redirects/migrations/0001_initial.py new file mode 100644 index 0000000..9eca3dc --- /dev/null +++ b/conman/redirects/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('routes', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='RouteRedirect', + fields=[ + ('route_ptr', models.OneToOneField(serialize=False, auto_created=True, to='routes.Route', parent_link=True, primary_key=True)), + ('permanent', models.BooleanField(default=False)), + ('target', models.ForeignKey(to='routes.Route', related_name='+')), + ], + options={ + 'ordering': ('tree_id', 'lft'), + 'abstract': False, + }, + bases=('routes.route',), + ), + ] diff --git a/conman/redirects/migrations/__init__.py b/conman/redirects/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conman/routes/migrations/0001_initial.py b/conman/routes/migrations/0001_initial.py new file mode 100644 index 0000000..25636fc --- /dev/null +++ b/conman/routes/migrations/0001_initial.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import polymorphic_tree.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('contenttypes', '0002_remove_content_type_name'), + ] + + operations = [ + migrations.CreateModel( + name='Route', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('slug', models.SlugField(help_text='\n Used to create the location of the Route. The Root Route needs\n "slug" to be blank; all other Routes need a value unique to the parent.\n It can only contain letters, numbers, underscores, or hyphens.\n ', default='', max_length=255)), + ('url', models.TextField(unique=True, editable=False, db_index=True)), + ('lft', models.PositiveIntegerField(editable=False, db_index=True)), + ('rght', models.PositiveIntegerField(editable=False, db_index=True)), + ('tree_id', models.PositiveIntegerField(editable=False, db_index=True)), + ('level', models.PositiveIntegerField(editable=False, db_index=True)), + ('parent', polymorphic_tree.models.PolymorphicTreeForeignKey(null=True, related_name='children', blank=True, to='routes.Route')), + ('polymorphic_ctype', models.ForeignKey(null=True, related_name='polymorphic_routes.route_set+', editable=False, to='contenttypes.ContentType')), + ], + ), + migrations.AlterUniqueTogether( + name='route', + unique_together=set([('parent', 'slug')]), + ), + ] diff --git a/conman/routes/migrations/__init__.py b/conman/routes/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conman/routes/tests/test_models.py b/conman/routes/tests/test_models.py index bfa89c4..8061a97 100644 --- a/conman/routes/tests/test_models.py +++ b/conman/routes/tests/test_models.py @@ -37,6 +37,10 @@ def test_fields(self): 'id', 'routeredirect', 'page', + + # Incoming foreign keys from subclasses in tests + 'routewithhandler', + 'routewithouthandler', ) + NODE_BASE_FIELDS fields = Route._meta.get_all_field_names() self.assertCountEqual(fields, expected) diff --git a/conman/tests/run.py b/conman/tests/run.py index 8895940..e61a687 100644 --- a/conman/tests/run.py +++ b/conman/tests/run.py @@ -15,8 +15,6 @@ )}, DEFAULT_FILE_STORAGE='inmemorystorage.InMemoryStorage', INSTALLED_APPS=( - # Put contenttypes before auth to work around test issue. - # See: https://code.djangoproject.com/ticket/10827#comment:12 'conman.cms', 'conman.routes', 'conman.pages', diff --git a/example/requirements.txt b/example/requirements.txt index ba427ba..b60bad5 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,5 +1,5 @@ -e .. dj-database-url==0.3 -django==1.7.0 -psycopg2==2.5.4 +django==1.8.3 +psycopg2==2.6.1 diff --git a/requirements.txt b/requirements.txt index 365a02a..b3021c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,11 +2,11 @@ colour-runner==0.0.4 coverage==3.7.1 dj-database-url==0.3 -django==1.7.0 -factory_boy==2.4.1 +django==1.8.3 +factory_boy==2.5.2 flake8==2.2.3 flake8-docstrings==0.2.1 flake8-import-order==0.5.1 -incuna-test-utils==4.0.0 -psycopg2==2.5.4 +incuna-test-utils==6.3.1 +psycopg2==2.6.1 wheel==0.24.0