Skip to content

Commit

Permalink
Merge ad2cc24 into 1f37350
Browse files Browse the repository at this point in the history
  • Loading branch information
stop5 committed Sep 25, 2017
2 parents 1f37350 + ad2cc24 commit 01da7c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion sitetree/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.conf import settings as django_settings
from django import VERSION as django_version
from django.core.urlresolvers import get_urlconf, get_resolver
try:
from django.urls import get_urlconf, get_resolver
except ImportError:
from django.core.urlresolvers import get_urlconf, get_resolver
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.http import HttpResponseRedirect
Expand Down
4 changes: 2 additions & 2 deletions sitetree/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TreeItemBase(models.Model):
'<b>Note:</b> Refer to Django "URL dispatcher" documentation (e.g. "Naming URL patterns" part).'),
db_index=True, default=False)
tree = models.ForeignKey(
MODEL_TREE, related_name='%(class)s_tree', verbose_name=_('Site Tree'),
MODEL_TREE, related_name='%(class)s_tree', on_delete=models.CASCADE, verbose_name=_('Site Tree'),
help_text=_('Site tree this item belongs to.'), db_index=True)
hidden = models.BooleanField(
_('Hidden'), help_text=_('Whether to show this item in navigation.'), db_index=True, default=False)
Expand Down Expand Up @@ -118,7 +118,7 @@ class TreeItemBase(models.Model):
# These two are for 'adjacency list' model.
# This is the current approach of tree representation for sitetree.
parent = models.ForeignKey(
'self', related_name='%(class)s_parent', verbose_name=_('Parent'),
'self', related_name='%(class)s_parent', on_delete=models.CASCADE, verbose_name=_('Parent'),
help_text=_('Parent site tree item.'), db_index=True, null=True, blank=True)
sort_order = models.IntegerField(
_('Sort order'),
Expand Down

0 comments on commit 01da7c3

Please sign in to comment.