Skip to content
This repository was archived by the owner on Apr 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Sponsored by [Incuna](http://incuna.com/).

Tested against:
- Python 3.4
- Django 1.7
- Django 1.8

Requires:
- `django-mptt`
Expand Down
27 changes: 27 additions & 0 deletions conman/pages/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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',),
),
]
Empty file.
27 changes: 27 additions & 0 deletions conman/redirects/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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',),
),
]
Empty file.
33 changes: 33 additions & 0 deletions conman/routes/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the slug.help_text is correctly defined. Perhaps it should be using textwrap.dedent?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think you're right, this is odd. Really, it should just be one line, as that's how I am expecting it to appear in the admin.

#48

('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')]),
),
]
Empty file.
4 changes: 4 additions & 0 deletions conman/routes/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions conman/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions example/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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