Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed flat urls

  • Loading branch information...
commit 3e4a6f9dd1d5631df07eba90e22ce34c76e92e17 1 parent 4b968ce
@digi604 authored
View
2  CHANGELOG.txt
@@ -119,6 +119,8 @@
- CMS_SITE_LANGUAGES setting removed
- CMS_FRONTEND_LANGUAGES setting removed
- MultilingualMiddleware has been removed
+- CMS_FLAT_URLS has been removed
+
View
3  cms/conf/__init__.py
@@ -16,9 +16,6 @@ def patch_settings():
return
patch_settings.ALREADY_PATCHED = True
- if getattr(settings, 'CMS_FLAT_URLS', False):
- warnings.warn("CMS_FLAT_URLS are deprecated and will be removed in django CMS 2.4!", CMSDeprecationWarning)
-
if getattr(settings, 'CMS_MODERATOR', False):
warnings.warn("CMS_MODERATOR will be removed and replaced in django CMS 2.4!", CMSDeprecationWarning)
View
3  cms/conf/global_settings.py
@@ -64,9 +64,6 @@
# a tuple of python path to AppHook Classes. Overwrites the auto-discovered apphooks.
CMS_APPHOOKS = ()
-#Should the tree of the pages be also be displayed in the urls? or should a flat slug structure be used?
-CMS_FLAT_URLS = False
-
# Wheter the cms has a softroot functionionality
CMS_SOFTROOT = False
View
3  cms/models/pagemodel.py
@@ -116,9 +116,6 @@ def __unicode__(self):
def get_absolute_url(self, language=None, fallback=True):
if self.is_home():
return reverse('pages-root')
- if settings.CMS_FLAT_URLS:
- path = self.get_slug(language, fallback)
- return urlutils.urljoin(reverse('pages-root'), path)
path = self.get_path(language, fallback)
return reverse('pages-details-by-slug', kwargs={"slug":path})
View
1  cms/test_utils/cli.py
@@ -195,7 +195,6 @@ def configure(**extra):
CMS_APPHOOKS=[],
CMS_REDIRECTS = True,
CMS_SEO_FIELDS = True,
- CMS_FLAT_URLS = False,
CMS_MENU_TITLE_OVERWRITE = True,
CMS_URL_OVERWRITE = True,
CMS_SHOW_END_DATE = True,
View
23 cms/tests/page.py
@@ -406,28 +406,7 @@ def test_edit_page_other_site_and_language(self):
page = Page.objects.get(title_set__slug=page_data['slug'])
with LanguageOverride(TESTLANG):
self.assertEqual(page.get_title(), 'changed title')
-
- def test_flat_urls(self):
- with SettingsOverride(CMS_FLAT_URLS=True):
- home_slug = "home"
- child_slug = "child"
- grandchild_slug = "grandchild"
- home = create_page(home_slug, "nav_playground.html", "en",
- published=True, in_navigation=True)
- home.publish()
- child = create_page(child_slug, "nav_playground.html", "en",
- parent=home, published=True, in_navigation=True)
- child.publish()
- grandchild = create_page(grandchild_slug, "nav_playground.html", "en",
- parent=child, published=True, in_navigation=True)
- grandchild.publish()
- response = self.client.get(home.get_absolute_url())
- self.assertEqual(response.status_code, 200)
- response = self.client.get(child.get_absolute_url())
- self.assertEqual(response.status_code, 200)
- response = self.client.get(grandchild.get_absolute_url())
- self.assertEqual(response.status_code, 200)
- self.assertFalse(child.get_absolute_url() in grandchild.get_absolute_url())
+
def test_templates(self):
"""
View
15 cms/utils/page.py
@@ -20,15 +20,14 @@ def is_valid_page_slug(page, parent, lang, slug, site, path=None):
if settings.USE_I18N:
qs = qs.filter(language=lang)
- if not settings.CMS_FLAT_URLS:
- if parent:
- if parent.is_home():
- qs = qs.filter(Q(page__parent=parent) |
- Q(page__parent__isnull=True))
- else:
- qs = qs.filter(page__parent=parent)
+ if parent:
+ if parent.is_home():
+ qs = qs.filter(Q(page__parent=parent) |
+ Q(page__parent__isnull=True))
else:
- qs = qs.filter(page__parent__isnull=True)
+ qs = qs.filter(page__parent=parent)
+ else:
+ qs = qs.filter(page__parent__isnull=True)
if page.pk:
qs = qs.exclude(Q(language=lang) & Q(page=page))
View
6 cms/utils/page_resolver.py
@@ -73,11 +73,7 @@ def get_page_queryset_from_path(path, preview=False, site=None):
# title_set__path=path should be clear, get the pages where the path of the
# title object is equal to our path.
- if settings.CMS_FLAT_URLS:
- query = Q(title_set__slug=path)
- else:
- query = Q(title_set__path=path)
- return pages.filter(query).distinct()
+ return pages.filter(title_set__path=path).distinct()
def get_page_from_path(path, preview=False):
View
16 docs/getting_started/configuration.rst
@@ -425,22 +425,6 @@ accessed.
Note: Don't use this too much. :mod:`django.contrib.redirects` is much more
flexible, handy, and is designed exactly for this purpose.
-.. setting:: CMS_FLAT_URLS
-
-CMS_FLAT_URLS
-=============
-
-.. deprecated:: 2.4
-
- ``CMS_FLAT_URLS`` will be removed in 2.4.
-
-Default: ``False``
-
-If this is enabled the slugs are not nested in the urls.
-
-So a page with a "world" slug will have a "/world" url, even it is a child of
-the "hello" page. If disabled the page would have the url: "/hello/world/"
-
.. setting:: CMS_SOFTROOT
CMS_SOFTROOT
View
8 docs/upgrade/2.4.rst
@@ -123,6 +123,14 @@ The following settings are not needed any more and have been removed:
Please remove them from your settings.py
+CMS_FLAT_URLS
+=============
+
+Was marked deprecated in 2.3 and has now been removed.
+
+
+
+
..
Feature description
Please sign in to comment.
Something went wrong with that request. Please try again.