Skip to content

Commit

Permalink
Merge pull request #110 from ccnmtl/django-19
Browse files Browse the repository at this point in the history
Django 1.9 compatibility
  • Loading branch information
thraxil committed Dec 4, 2015
2 parents dbdfa4f + 32f3460 commit 84421d3
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 1,038 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ sudo: false
python:
- "2.7"
env:
- DJANGO="Django>=1.6.0,<1.7.0"
- DJANGO="Django>=1.7.0,<1.8.0"
- DJANGO="Django>=1.8.0,<1.9.0"
- DJANGO="Django>=1.9.0,<1.10.0"

# command to install dependencies
install:
Expand Down
3 changes: 0 additions & 3 deletions pagetree/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
# This is required for south's syncdb to pick up TestBlock in
# Django 1.6
from pagetree.test_models import *
6 changes: 1 addition & 5 deletions pagetree/generic/models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from django import forms
from django.db import models
try:
from django.contrib.contenttypes.fields import GenericRelation
except ImportError:
# Old location for django 1.6
from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.fields import GenericRelation

from pagetree.models import PageBlock

Expand Down
10 changes: 3 additions & 7 deletions pagetree/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import random
try:
from django.apps import apps
except ImportError:
# Django <= 1.6
from django.db.models import get_model
from django.apps import apps
from django.contrib.auth.models import User
from django.core.cache import cache
from django.db import models
Expand All @@ -12,7 +8,7 @@
from django.template.loader import get_template
from django.http import Http404
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.fields import GenericForeignKey
from django.template.defaultfilters import slugify
from json import dumps
from treebeard.mp_tree import MP_Node
Expand Down Expand Up @@ -676,7 +672,7 @@ class PageBlock(models.Model):

content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
content_object = GenericForeignKey('content_type', 'object_id')

class Meta:
ordering = ('section', 'ordinality',)
Expand Down
6 changes: 1 addition & 5 deletions pagetree/reports.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import abc

from django.contrib.auth.models import User
try:
from django.apps import apps
except ImportError:
# Django <= 1.6
from django.db import models
from django.apps import apps
from django.contrib.contenttypes.models import ContentType


Expand Down
91 changes: 0 additions & 91 deletions pagetree/south_migrations/0001_initial.py

This file was deleted.

98 changes: 0 additions & 98 deletions pagetree/south_migrations/0002_auto__add_userlocation.py

This file was deleted.

0 comments on commit 84421d3

Please sign in to comment.