From 70100b5b4316e072328f6b7765d6e25cc21fa83c Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Tue, 16 Jun 2015 11:45:20 +0100 Subject: [PATCH] Convert url_path to a text field - fixes #1216 --- ...0016_change_page_url_path_to_text_field.py | 20 +++++++++++++++++++ wagtail/wagtailcore/models.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 wagtail/wagtailcore/migrations/0016_change_page_url_path_to_text_field.py diff --git a/wagtail/wagtailcore/migrations/0016_change_page_url_path_to_text_field.py b/wagtail/wagtailcore/migrations/0016_change_page_url_path_to_text_field.py new file mode 100644 index 0000000000..d583afd61a --- /dev/null +++ b/wagtail/wagtailcore/migrations/0016_change_page_url_path_to_text_field.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0015_add_more_verbose_names'), + ] + + operations = [ + migrations.AlterField( + model_name='page', + name='url_path', + field=models.TextField(verbose_name='URL path', editable=False, blank=True), + preserve_default=True, + ), + ] diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index fe8bb728a9..479fdef344 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -274,7 +274,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed content_type = models.ForeignKey('contenttypes.ContentType', verbose_name=_('Content type'), related_name='pages') live = models.BooleanField(verbose_name=_('Live'), default=True, editable=False) has_unpublished_changes = models.BooleanField(verbose_name=_('Has unpublished changes'), default=False, editable=False) - url_path = models.CharField(verbose_name=_('URL path'), max_length=255, blank=True, editable=False) + url_path = models.TextField(verbose_name=_('URL path'), blank=True, editable=False) owner = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('Owner'), null=True, blank=True, editable=False, on_delete=models.SET_NULL, related_name='owned_pages') seo_title = models.CharField(verbose_name=_("Page title"), max_length=255, blank=True, help_text=_("Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window."))