From dccb47178bef5feaae413854f764cb16dfb7d4d2 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 15 Jul 2014 10:38:50 +0100 Subject: [PATCH 01/66] Added tutorial for creating multilingual sites --- docs/index.rst | 1 + docs/multilingual_sites.rst | 145 ++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 docs/multilingual_sites.rst diff --git a/docs/index.rst b/docs/index.rst index 2ab429eb6..582e5aa82 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,6 +16,7 @@ It supports Django 1.6.2+ on Python 2.6, 2.7, 3.2, 3.3 and 3.4. Django 1.7 suppo search/index form_builder model_recipes + multilingual_sites advanced_topics deploying performance diff --git a/docs/multilingual_sites.rst b/docs/multilingual_sites.rst new file mode 100644 index 000000000..f8f9e1f73 --- /dev/null +++ b/docs/multilingual_sites.rst @@ -0,0 +1,145 @@ +=========================== +Creating multilingual sites +=========================== + +This tutorial will show you a method of creating multilingual sites in Wagtail. + +Currently, Wagtail doesn't support multiple languages in the same page. The recommended way of creating multilingual websites in Wagtail at the moment is to create one section of your website for each language. + +For example:: + + / + en/ + about/ + contact/ + fr/ + about/ + contact/ + + +The root page +============= + +The root page (``/``) should detect the browsers language and forward them to the correct language homepage (``/en/``, ``/fr/``). This page should sit at the site root (where the homepage would normally be). + +We must set Djangos ``LANGUAGES`` setting so we don't redirect non English/French users to pages that don't exist. + + +.. code-block:: python + + # settings.py + LANGUAGES = ( + ('en', _("English")), + ('fr', _("French")), + ) + + # models.py + from django.utils import translation + from django.http import HttpResponseRedirect + + from wagtail.wagtailcore.models import Page + + + class LanguageRedirectionPage(Page): + + def serve(self, request): + # This will only return a language that is in the LANGUAGES Django setting + language = translation.get_language_from_request(request) + + return HttpResponseRedirect(self.url + language + '/') + + +Linking pages together +====================== + +It may be useful to link different versions of the same page together to allow the user to easily switch between languages. But we don't want to increse the burdon on the editor too much so ideally, editors should only need to link one of the pages to the other versions and the links between the other versions should be created implicitly. + +As this behaviour needs to be added to all page types that would be translated, its best to put this behaviour in a mixin. + +Heres an example of how this could be implemented (with English as the main language and French/Spanish as alternative languages): + +.. code-block:: python + + class TranslatablePageMixin(models.Model): + # One link for each alternative language + # These should only be used on the main language page (english) + french_link = models.ForeignKey(Page, null=True, on_delete=models.SET_NULL, blank=True, related_name='+') + spanish_link = models.ForeignKey(Page, null=True, on_delete=models.SET_NULL, blank=True, related_name='+') + + def get_language(self): + """ + This returns the language code for this page. + """ + # Look through ancestors of this pages for its language homepage + # The language homepage is located at depth 3 + language_homepage = self.get_ancestors(inclusive=True).get(depth=3) + + return language_homepage.slug + + + # Method to find the main language version of this page + # This works by reversing the above links + + def english_page(self): + """ + This finds the english version of this page + """ + language = self.get_language() + + if language == 'en': + return self + elif language == 'fr': + return type(self).objects.filter(french_link=self).first().specific + elif language == 'es': + return type(self).objects.filter(spanish_link=self).first().specific + + + # We need a method to find a version of this page for each alternative language. + # These all work the same way. They firstly find the main version of the page + # (english), then from there they can just follow the link to the correct page. + + def french_page(self): + """ + This finds the french version of this page + """ + english_page = self.english_page() + + if english_page and english_page.french_link: + return english_page.french_link.specific + + def spanish_page(self): + """ + This finds the spanish version of this page + """ + english_page = self.english_page() + + if english_page and english_page.spanish_link: + return english_page.spanish_link.specific + + class Meta: + abstract = True + + + class AboutPage(Page, TranslatablePageMixin): + ... + + + class ContactPage(Page, TranslatablePageMixin): + ... + + +You can make use of these methods in your template by doing: + +.. code-block:: django + + {% if self.english_page and self.get_langage != 'en' %} + {% trans "View in English" %} + {% endif %} + + {% if self.french_page and self.get_langage != 'fr' %} + {% trans "View in French" %} + {% endif %} + + {% if self.spanish_page and self.get_langage != 'es' %} + {% trans "View in Spanish" %} + {% endif %} From a4c847c35df418fe4653f110ab816ef0beb8c2ef Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 15 Jul 2014 10:43:40 +0100 Subject: [PATCH 02/66] Typo fixes --- docs/multilingual_sites.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/multilingual_sites.rst b/docs/multilingual_sites.rst index f8f9e1f73..b5aca82fb 100644 --- a/docs/multilingual_sites.rst +++ b/docs/multilingual_sites.rst @@ -132,14 +132,14 @@ You can make use of these methods in your template by doing: .. code-block:: django - {% if self.english_page and self.get_langage != 'en' %} + {% if self.english_page and self.get_language != 'en' %} {% trans "View in English" %} {% endif %} - {% if self.french_page and self.get_langage != 'fr' %} + {% if self.french_page and self.get_language != 'fr' %} {% trans "View in French" %} {% endif %} - {% if self.spanish_page and self.get_langage != 'es' %} + {% if self.spanish_page and self.get_language != 'es' %} {% trans "View in Spanish" %} {% endif %} From f8a24ae255552f74b5b1f081eb6a79f652af4760 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 15 Jul 2014 10:49:12 +0100 Subject: [PATCH 03/66] Tweaks to multilingual tutorial --- docs/multilingual_sites.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/multilingual_sites.rst b/docs/multilingual_sites.rst index b5aca82fb..1d73a18fb 100644 --- a/docs/multilingual_sites.rst +++ b/docs/multilingual_sites.rst @@ -70,10 +70,11 @@ Heres an example of how this could be implemented (with English as the main lang """ This returns the language code for this page. """ - # Look through ancestors of this pages for its language homepage + # Look through ancestors of this page for its language homepage # The language homepage is located at depth 3 language_homepage = self.get_ancestors(inclusive=True).get(depth=3) + # The slug of language homepages should always be set to the language code return language_homepage.slug From cd39f305a53b9049245a4c1ef4dc5fe9304ae64c Mon Sep 17 00:00:00 2001 From: Dave Cranwell Date: Fri, 25 Jul 2014 14:36:38 +0100 Subject: [PATCH 04/66] fixing search in page chooser, which would allow selection of any page even if the developer has chosen to restrict to only certain types allowed. --- .../wagtailadmin/chooser/_search_results.html | 22 ++++++++++++++----- .../wagtailadmin/chooser/browse.html | 12 ++++++---- .../templates/wagtailadmin/shared/header.html | 2 +- wagtail/wagtailadmin/views/chooser.py | 14 +++++++++--- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html index 6f575259e..7554187eb 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html @@ -1,11 +1,19 @@ {% load i18n %} + +{% if is_restricted %} +

+ {% blocktrans with type=page_type.get_verbose_name %} + Only pages of type "{{ type }}" may be chosen for this field. Search results will exclude pages of other types. + {% endblocktrans %} +

+{% endif %} + {% if not is_searching %}

{% trans "Explorer" %}

{% include "wagtailadmin/shared/breadcrumb.html" with page=parent_page choosing=1 %} - {% else %}

- {% blocktrans count counter=pages.count %} + {% blocktrans count counter=pages|length %} There is one match {% plural %} There are {{ counter }} matches @@ -13,8 +21,10 @@

{% endif %} -{% if is_searching %} - {% include "wagtailadmin/pages/list.html" with choosing=1 show_parent=1 pages=pages parent_page=parent_page %} -{% else %} - {% include "wagtailadmin/pages/list.html" with choosing=1 allow_navigation=1 orderable=0 pages=pages parent_page=parent_page %} +{% if pages %} + {% if is_searching%} + {% include "wagtailadmin/pages/list.html" with choosing=1 show_parent=1 pages=pages parent_page=parent_page %} + {% else %} + {% include "wagtailadmin/pages/list.html" with choosing=1 allow_navigation=1 orderable=0 pages=pages parent_page=parent_page %} + {% endif %} {% endif %} \ No newline at end of file diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html index 5714ddb45..50e81c0f1 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html @@ -1,13 +1,17 @@ {% load i18n %} -{% trans "Choose a page" as choose_str %} -{% include "wagtailadmin/shared/header.html" with title=choose_str search_url="wagtailadmin_choose_page" icon="doc-empty-inverse" %} +{% if is_restricted %} + {% trans "Choose" as choose_str %} + {% trans page_type.get_verbose_name as subtitle %} +{% else %} + {% trans "Choose a page" as choose_str %} +{% endif %} + +{% include "wagtailadmin/shared/header.html" with title=choose_str subtitle=subtitle search_url="wagtailadmin_choose_page" query_parameters="page_type="|add:page_type_string icon="doc-empty-inverse" %}
{% include 'wagtailadmin/chooser/_link_types.html' with current='internal' %}
- {# content in here will be replaced by live search results #} - {% include 'wagtailadmin/chooser/_search_results.html' %}
diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/shared/header.html b/wagtail/wagtailadmin/templates/wagtailadmin/shared/header.html index be391989d..b5de84832 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/shared/header.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/shared/header.html @@ -5,7 +5,7 @@

{{ title }} {{ subtitle }}

{% if search_url %} -
+
    {% for field in search_form %} {% include "wagtailadmin/shared/field_as_li.html" with field=field field_classes="field-small iconfield" input_classes="icon-search" %} diff --git a/wagtail/wagtailadmin/views/chooser.py b/wagtail/wagtailadmin/views/chooser.py index 31cad20db..f075dd540 100644 --- a/wagtail/wagtailadmin/views/chooser.py +++ b/wagtail/wagtailadmin/views/chooser.py @@ -3,6 +3,7 @@ from django.shortcuts import get_object_or_404, render from django.http import Http404 from django.utils.http import urlencode from django.contrib.auth.decorators import permission_required +from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from wagtail.wagtailadmin.modal_workflow import render_modal_workflow from wagtail.wagtailadmin.forms import SearchForm, ExternalLinkChooserForm, ExternalLinkChooserWithLinkTextForm, EmailLinkChooserForm, EmailLinkChooserWithLinkTextForm @@ -25,6 +26,7 @@ def browse(request, parent_page_id=None): content_type_app_name, content_type_model_name = page_type.split('.') is_searching = False + is_restricted = page_type != 'wagtailcore.page' try: content_type = ContentType.objects.get_by_natural_key(content_type_app_name, content_type_model_name) @@ -66,8 +68,11 @@ def browse(request, parent_page_id=None): return render(request, 'wagtailadmin/chooser/_search_results.html', { 'querystring': get_querystring(request), 'searchform': search_form, - 'pages': pages, - 'is_searching': is_searching + 'pages': shown_pages, + 'is_searching': is_searching, + 'page_type_string': page_type, + 'page_type': desired_class, + 'is_restricted': is_restricted }) return render_modal_workflow(request, 'wagtailadmin/chooser/browse.html', 'wagtailadmin/chooser/browse.js', { @@ -77,7 +82,10 @@ def browse(request, parent_page_id=None): 'parent_page': parent_page, 'pages': shown_pages, 'search_form': search_form, - 'is_searching': False + 'is_searching': False, + 'page_type_string': page_type, + 'page_type': desired_class, + 'is_restricted': is_restricted }) From 6d50ae5d65d47ce1462547b6b9e9bb06c118792d Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 11:36:11 +0100 Subject: [PATCH 05/66] Only enable south in tests if were testing with Django 1.6 --- wagtail/tests/settings.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wagtail/tests/settings.py b/wagtail/tests/settings.py index 1ef1c5ab1..444baca65 100644 --- a/wagtail/tests/settings.py +++ b/wagtail/tests/settings.py @@ -1,5 +1,6 @@ import os +import django from django.conf import global_settings @@ -57,7 +58,6 @@ INSTALLED_APPS = [ 'django.contrib.admin', 'taggit', - 'south', 'compressor', 'wagtail.wagtailcore', @@ -76,6 +76,11 @@ INSTALLED_APPS = [ 'wagtail.tests', ] +# If we are using Django 1.6, add South to INSTALLED_APPS +if django.VERSION[:2] == (1, 6): + INSTALLED_APPS.append('south') + + # Using DatabaseCache to make sure that the cache is cleared between tests. # This prevents false-positives in some wagtail core tests where we are # changing the 'wagtail_root_paths' key which may cause future tests to fail. From fa75a11c61d338271bb1ebd700dddd3093f94fe6 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 11:46:02 +0100 Subject: [PATCH 06/66] Removed 'FakePage' from admin tests (upsets migrations) --- wagtail/wagtailadmin/tests/test_edit_handlers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wagtail/wagtailadmin/tests/test_edit_handlers.py b/wagtail/wagtailadmin/tests/test_edit_handlers.py index 8b499378c..0dd699ac1 100644 --- a/wagtail/wagtailadmin/tests/test_edit_handlers.py +++ b/wagtail/wagtailadmin/tests/test_edit_handlers.py @@ -43,9 +43,6 @@ class TestGetFormForModel(TestCase): class TestExtractPanelDefinitionsFromModelClass(TestCase): - class FakePage(Page): - pass - def test_can_extract_panels(self): mock = MagicMock() mock.panels = 'foo' @@ -58,7 +55,7 @@ class TestExtractPanelDefinitionsFromModelClass(TestCase): self.assertNotEqual(panel.field_name, 'hostname') def test_extracted_objects_are_panels(self): - panels = extract_panel_definitions_from_model_class(self.FakePage) + panels = extract_panel_definitions_from_model_class(Page) for panel in panels: self.assertTrue(issubclass(panel, BaseFieldPanel)) From c5044eb0e500e6408a4e19c57c219f914c165578 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 11:57:23 +0100 Subject: [PATCH 07/66] Moved get_upload_to outside of Image model --- wagtail/wagtailimages/models.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/wagtail/wagtailimages/models.py b/wagtail/wagtailimages/models.py index c561cdcc5..cd2b7f111 100644 --- a/wagtail/wagtailimages/models.py +++ b/wagtail/wagtailimages/models.py @@ -24,23 +24,23 @@ from wagtail.wagtailsearch import indexed from .utils import validate_image_format +def get_upload_to(self, filename): + folder_name = 'original_images' + filename = self.file.field.storage.get_valid_name(filename) + + # do a unidecode in the filename and then + # replace non-ascii characters in filename with _ , to sidestep issues with filesystem encoding + filename = "".join((i if ord(i) < 128 else '_') for i in unidecode(filename)) + + while len(os.path.join(folder_name, filename)) >= 95: + prefix, dot, extension = filename.rpartition('.') + filename = prefix[:-1] + dot + extension + return os.path.join(folder_name, filename) + + @python_2_unicode_compatible class AbstractImage(models.Model, TagSearchable): title = models.CharField(max_length=255, verbose_name=_('Title') ) - - def get_upload_to(self, filename): - folder_name = 'original_images' - filename = self.file.field.storage.get_valid_name(filename) - - # do a unidecode in the filename and then - # replace non-ascii characters in filename with _ , to sidestep issues with filesystem encoding - filename = "".join((i if ord(i) < 128 else '_') for i in unidecode(filename)) - - while len(os.path.join(folder_name, filename)) >= 95: - prefix, dot, extension = filename.rpartition('.') - filename = prefix[:-1] + dot + extension - return os.path.join(folder_name, filename) - file = models.ImageField(verbose_name=_('File'), upload_to=get_upload_to, width_field='width', height_field='height', validators=[validate_image_format]) width = models.IntegerField(editable=False) height = models.IntegerField(editable=False) From 3c642874886f27df8266f55eea80a7fb924158ee Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 11:36:25 +0100 Subject: [PATCH 08/66] Created initial Django 1.7 migrations --- wagtail/tests/migrations/0001_initial.py | 298 ++++++++++++++++++ wagtail/tests/migrations/__init__.py | 0 .../wagtailcore/migrations/0001_initial.py | 104 ++++++ wagtail/wagtailcore/migrations/__init__.py | 0 .../wagtaildocs/migrations/0001_initial.py | 33 ++ wagtail/wagtaildocs/migrations/__init__.py | 0 .../wagtailembeds/migrations/0001_initial.py | 37 +++ wagtail/wagtailembeds/migrations/__init__.py | 0 .../wagtailforms/migrations/0001_initial.py | 26 ++ wagtail/wagtailforms/migrations/__init__.py | 0 .../wagtailimages/migrations/0001_initial.py | 66 ++++ wagtail/wagtailimages/migrations/__init__.py | 0 .../migrations/0001_initial.py | 28 ++ .../wagtailredirects/migrations/__init__.py | 0 .../wagtailsearch/migrations/0001_initial.py | 59 ++++ wagtail/wagtailsearch/migrations/__init__.py | 0 .../wagtailusers/migrations/0001_initial.py | 28 ++ wagtail/wagtailusers/migrations/__init__.py | 0 18 files changed, 679 insertions(+) create mode 100644 wagtail/tests/migrations/0001_initial.py create mode 100644 wagtail/tests/migrations/__init__.py create mode 100644 wagtail/wagtailcore/migrations/0001_initial.py create mode 100644 wagtail/wagtailcore/migrations/__init__.py create mode 100644 wagtail/wagtaildocs/migrations/0001_initial.py create mode 100644 wagtail/wagtaildocs/migrations/__init__.py create mode 100644 wagtail/wagtailembeds/migrations/0001_initial.py create mode 100644 wagtail/wagtailembeds/migrations/__init__.py create mode 100644 wagtail/wagtailforms/migrations/0001_initial.py create mode 100644 wagtail/wagtailforms/migrations/__init__.py create mode 100644 wagtail/wagtailimages/migrations/0001_initial.py create mode 100644 wagtail/wagtailimages/migrations/__init__.py create mode 100644 wagtail/wagtailredirects/migrations/0001_initial.py create mode 100644 wagtail/wagtailredirects/migrations/__init__.py create mode 100644 wagtail/wagtailsearch/migrations/0001_initial.py create mode 100644 wagtail/wagtailsearch/migrations/__init__.py create mode 100644 wagtail/wagtailusers/migrations/0001_initial.py create mode 100644 wagtail/wagtailusers/migrations/__init__.py diff --git a/wagtail/tests/migrations/0001_initial.py b/wagtail/tests/migrations/0001_initial.py new file mode 100644 index 000000000..9b6592118 --- /dev/null +++ b/wagtail/tests/migrations/0001_initial.py @@ -0,0 +1,298 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +import wagtail.wagtailsearch.indexed +import modelcluster.fields +import wagtail.wagtailcore.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0001_initial'), + ('wagtailcore', '0001_initial'), + ('wagtaildocs', '__latest__'), + ] + + operations = [ + migrations.CreateModel( + name='Advert', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('url', models.URLField(null=True, blank=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AlphaSnippet', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BusinessChild', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BusinessIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BusinessSubIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventPage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('date_from', models.DateField(null=True, verbose_name=b'Start date')), + ('date_to', models.DateField(help_text=b'Not required if event is on a single day', null=True, verbose_name=b'End date', blank=True)), + ('time_from', models.TimeField(null=True, verbose_name=b'Start time', blank=True)), + ('time_to', models.TimeField(null=True, verbose_name=b'End time', blank=True)), + ('audience', models.CharField(max_length=255, choices=[(b'public', b'Public'), (b'private', b'Private')])), + ('location', models.CharField(max_length=255)), + ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('cost', models.CharField(max_length=255)), + ('signup_link', models.URLField(blank=True)), + ('feed_image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventPageCarouselItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), + ('caption', models.CharField(max_length=255, blank=True)), + ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageSpeaker', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('first_name', models.CharField(max_length=255, verbose_name=b'Name', blank=True)), + ('last_name', models.CharField(max_length=255, verbose_name=b'Surname', blank=True)), + ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormField', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('label', models.CharField(help_text='The label of the form field', max_length=255)), + ('field_type', models.CharField(max_length=16, choices=[(b'singleline', 'Single line text'), (b'multiline', 'Multi-line text'), (b'email', 'Email'), (b'number', 'Number'), (b'url', 'URL'), (b'checkbox', 'Checkbox'), (b'checkboxes', 'Checkboxes'), (b'dropdown', 'Drop down'), (b'radio', 'Radio buttons'), (b'date', 'Date'), (b'datetime', 'Date/time')])), + ('required', models.BooleanField(default=True)), + ('choices', models.CharField(help_text='Comma seperated list of choices. Only applicable in checkboxes, radio and dropdown.', max_length=512, blank=True)), + ('default_value', models.CharField(help_text='Default value. Comma seperated values supported for checkboxes.', max_length=255, blank=True)), + ('help_text', models.CharField(max_length=255, blank=True)), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormPage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('to_address', models.CharField(help_text='Optional - form submissions will be emailed to this address', max_length=255, blank=True)), + ('from_address', models.CharField(max_length=255, blank=True)), + ('subject', models.CharField(max_length=255, blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.AddField( + model_name='formfield', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.FormPage'), + preserve_default=True, + ), + migrations.CreateModel( + name='PageWithOldStyleRouteMethod', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('content', models.TextField()), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='RoutablePageTest', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='SearchTest', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('title', models.CharField(max_length=255)), + ('content', models.TextField()), + ('live', models.BooleanField(default=False)), + ('published_date', models.DateField(null=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), + ), + migrations.CreateModel( + name='SearchTestChild', + fields=[ + ('searchtest_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='tests.SearchTest')), + ('subtitle', models.CharField(max_length=255, null=True, blank=True)), + ('extra_content', models.TextField()), + ], + options={ + }, + bases=('tests.searchtest',), + ), + migrations.CreateModel( + name='SearchTestOldConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), + ), + migrations.CreateModel( + name='SearchTestOldConfigList', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), + ), + migrations.CreateModel( + name='SimplePage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('content', models.TextField()), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardChild', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='ZuluSnippet', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + ] diff --git a/wagtail/tests/migrations/__init__.py b/wagtail/tests/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailcore/migrations/0001_initial.py b/wagtail/wagtailcore/migrations/0001_initial.py new file mode 100644 index 000000000..3cb27f59b --- /dev/null +++ b/wagtail/wagtailcore/migrations/0001_initial.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from django.conf import settings +import wagtail.wagtailsearch.indexed + + +class Migration(migrations.Migration): + + dependencies = [ + ('contenttypes', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('auth', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='GroupPagePermission', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('permission_type', models.CharField(max_length=20, choices=[(b'add', b'Add'), (b'edit', b'Edit'), (b'publish', b'Publish')])), + ('group', models.ForeignKey(to='auth.Group')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Page', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('path', models.CharField(unique=True, max_length=255)), + ('depth', models.PositiveIntegerField()), + ('numchild', models.PositiveIntegerField(default=0)), + ('title', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255)), + ('slug', models.SlugField(help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/')), + ('live', models.BooleanField(default=True, editable=False)), + ('has_unpublished_changes', models.BooleanField(default=False, editable=False)), + ('url_path', models.CharField(max_length=255, editable=False, blank=True)), + ('seo_title', models.CharField(help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, verbose_name='Page title', blank=True)), + ('show_in_menus', models.BooleanField(default=False, help_text='Whether a link to this page will appear in automatically generated menus')), + ('search_description', models.TextField(blank=True)), + ('go_live_at', models.DateTimeField(help_text='Please add a date-time in the form YYYY-MM-DD hh:mm.', null=True, verbose_name='Go live date/time', blank=True)), + ('expire_at', models.DateTimeField(help_text='Please add a date-time in the form YYYY-MM-DD hh:mm.', null=True, verbose_name='Expiry date/time', blank=True)), + ('expired', models.BooleanField(default=False, editable=False)), + ('content_type', models.ForeignKey(to='contenttypes.ContentType')), + ('owner', models.ForeignKey(blank=True, editable=False, to=settings.AUTH_USER_MODEL, null=True)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), + ), + migrations.AddField( + model_name='grouppagepermission', + name='page', + field=models.ForeignKey(to='wagtailcore.Page'), + preserve_default=True, + ), + migrations.CreateModel( + name='PageRevision', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('submitted_for_moderation', models.BooleanField(default=False)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('content_json', models.TextField()), + ('approved_go_live_at', models.DateTimeField(null=True, blank=True)), + ('page', models.ForeignKey(to='wagtailcore.Page')), + ('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='PageViewRestriction', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('password', models.CharField(max_length=255)), + ('page', models.ForeignKey(to='wagtailcore.Page')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Site', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('hostname', models.CharField(max_length=255, db_index=True)), + ('port', models.IntegerField(default=80, help_text='Set this to something other than 80 if you need a specific port number to appear in URLs (e.g. development on port 8000). Does not affect request handling (so port forwarding still works).')), + ('is_default_site', models.BooleanField(default=False, help_text='If true, this site will handle requests for all other hostnames that do not have a site entry of their own')), + ('root_page', models.ForeignKey(to='wagtailcore.Page')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.AlterUniqueTogether( + name='site', + unique_together=set([(b'hostname', b'port')]), + ), + ] diff --git a/wagtail/wagtailcore/migrations/__init__.py b/wagtail/wagtailcore/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtaildocs/migrations/0001_initial.py b/wagtail/wagtaildocs/migrations/0001_initial.py new file mode 100644 index 000000000..2ca725717 --- /dev/null +++ b/wagtail/wagtaildocs/migrations/0001_initial.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from django.conf import settings +import taggit.models +import wagtail.wagtailadmin.taggable +import taggit.managers + + +class Migration(migrations.Migration): + + dependencies = [ + ('taggit', '__latest__'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Document', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('title', models.CharField(max_length=255, verbose_name='Title')), + ('file', models.FileField(upload_to=b'documents', verbose_name='File')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('tags', taggit.managers.TaggableManager(to=taggit.models.Tag, through=taggit.models.TaggedItem, blank=True, help_text=None, verbose_name='Tags')), + ('uploaded_by_user', models.ForeignKey(blank=True, editable=False, to=settings.AUTH_USER_MODEL, null=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable), + ), + ] diff --git a/wagtail/wagtaildocs/migrations/__init__.py b/wagtail/wagtaildocs/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailembeds/migrations/0001_initial.py b/wagtail/wagtailembeds/migrations/0001_initial.py new file mode 100644 index 000000000..e042c074c --- /dev/null +++ b/wagtail/wagtailembeds/migrations/0001_initial.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Embed', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('url', models.URLField()), + ('max_width', models.SmallIntegerField(null=True, blank=True)), + ('type', models.CharField(max_length=10, choices=[(b'video', b'Video'), (b'photo', b'Photo'), (b'link', b'Link'), (b'rich', b'Rich')])), + ('html', models.TextField(blank=True)), + ('title', models.TextField(blank=True)), + ('author_name', models.TextField(blank=True)), + ('provider_name', models.TextField(blank=True)), + ('thumbnail_url', models.URLField(null=True, blank=True)), + ('width', models.IntegerField(null=True, blank=True)), + ('height', models.IntegerField(null=True, blank=True)), + ('last_updated', models.DateTimeField(auto_now=True)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.AlterUniqueTogether( + name='embed', + unique_together=set([(b'url', b'max_width')]), + ), + ] diff --git a/wagtail/wagtailembeds/migrations/__init__.py b/wagtail/wagtailembeds/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailforms/migrations/0001_initial.py b/wagtail/wagtailforms/migrations/0001_initial.py new file mode 100644 index 000000000..868defc9e --- /dev/null +++ b/wagtail/wagtailforms/migrations/0001_initial.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='FormSubmission', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('form_data', models.TextField()), + ('submit_time', models.DateTimeField(auto_now_add=True)), + ('page', models.ForeignKey(to='wagtailcore.Page')), + ], + options={ + }, + bases=(models.Model,), + ), + ] diff --git a/wagtail/wagtailforms/migrations/__init__.py b/wagtail/wagtailforms/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailimages/migrations/0001_initial.py b/wagtail/wagtailimages/migrations/0001_initial.py new file mode 100644 index 000000000..0a72088d9 --- /dev/null +++ b/wagtail/wagtailimages/migrations/0001_initial.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import taggit.models +import wagtail.wagtailimages.models +import wagtail.wagtailimages.utils +import wagtail.wagtailadmin.taggable +from django.conf import settings +import taggit.managers + + +class Migration(migrations.Migration): + + dependencies = [ + ('taggit', '__latest__'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Filter', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('spec', models.CharField(max_length=255, db_index=True)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Image', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('title', models.CharField(max_length=255, verbose_name='Title')), + ('file', models.ImageField(upload_to=wagtail.wagtailimages.models.get_upload_to, width_field=b'width', height_field=b'height', validators=[wagtail.wagtailimages.utils.validate_image_format], verbose_name='File')), + ('width', models.IntegerField(editable=False)), + ('height', models.IntegerField(editable=False)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('tags', taggit.managers.TaggableManager(to=taggit.models.Tag, through=taggit.models.TaggedItem, blank=True, help_text=None, verbose_name='Tags')), + ('uploaded_by_user', models.ForeignKey(blank=True, editable=False, to=settings.AUTH_USER_MODEL, null=True)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable), + ), + migrations.CreateModel( + name='Rendition', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('file', models.ImageField(height_field=b'height', width_field=b'width', upload_to=b'images')), + ('width', models.IntegerField(editable=False)), + ('height', models.IntegerField(editable=False)), + ('filter', models.ForeignKey(to='wagtailimages.Filter')), + ('image', models.ForeignKey(to='wagtailimages.Image')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.AlterUniqueTogether( + name='rendition', + unique_together=set([(b'image', b'filter')]), + ), + ] diff --git a/wagtail/wagtailimages/migrations/__init__.py b/wagtail/wagtailimages/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailredirects/migrations/0001_initial.py b/wagtail/wagtailredirects/migrations/0001_initial.py new file mode 100644 index 000000000..5fb268020 --- /dev/null +++ b/wagtail/wagtailredirects/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Redirect', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('old_path', models.CharField(unique=True, max_length=255, verbose_name='Redirect from', db_index=True)), + ('is_permanent', models.BooleanField(default=True, help_text="Recommended. Permanent redirects ensure search engines forget the old page (the 'Redirect from') and index the new page instead.", verbose_name='Permanent')), + ('redirect_link', models.URLField(verbose_name='Redirect to any URL', blank=True)), + ('redirect_page', models.ForeignKey(verbose_name='Redirect to a page', blank=True, to='wagtailcore.Page', null=True)), + ('site', models.ForeignKey(blank=True, editable=False, to='wagtailcore.Site', null=True)), + ], + options={ + }, + bases=(models.Model,), + ), + ] diff --git a/wagtail/wagtailredirects/migrations/__init__.py b/wagtail/wagtailredirects/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailsearch/migrations/0001_initial.py b/wagtail/wagtailsearch/migrations/0001_initial.py new file mode 100644 index 000000000..ccf27a376 --- /dev/null +++ b/wagtail/wagtailsearch/migrations/0001_initial.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='EditorsPick', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('description', models.TextField(blank=True)), + ('page', models.ForeignKey(to='wagtailcore.Page')), + ], + options={ + 'ordering': (b'sort_order',), + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Query', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('query_string', models.CharField(unique=True, max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='editorspick', + name='query', + field=models.ForeignKey(to='wagtailsearch.Query'), + preserve_default=True, + ), + migrations.CreateModel( + name='QueryDailyHits', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('date', models.DateField()), + ('hits', models.IntegerField(default=0)), + ('query', models.ForeignKey(to='wagtailsearch.Query')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.AlterUniqueTogether( + name='querydailyhits', + unique_together=set([(b'query', b'date')]), + ), + ] diff --git a/wagtail/wagtailsearch/migrations/__init__.py b/wagtail/wagtailsearch/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailusers/migrations/0001_initial.py b/wagtail/wagtailusers/migrations/0001_initial.py new file mode 100644 index 000000000..6855c6c57 --- /dev/null +++ b/wagtail/wagtailusers/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='UserProfile', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('submitted_notifications', models.BooleanField(default=True, help_text='Receive notification when a page is submitted for moderation')), + ('approved_notifications', models.BooleanField(default=True, help_text='Receive notification when your page edit is approved')), + ('rejected_notifications', models.BooleanField(default=True, help_text='Receive notification when your page edit is rejected')), + ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), + ], + options={ + }, + bases=(models.Model,), + ), + ] diff --git a/wagtail/wagtailusers/migrations/__init__.py b/wagtail/wagtailusers/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb From 78643d40cdbb0ed289a478e1afd5455925c65759 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 12:21:08 +0100 Subject: [PATCH 09/66] Created initial data migrations --- .../0001_create_admin_access_permissions.py | 41 +++++++++ wagtail/wagtailadmin/migrations/__init__.py | 0 .../migrations/0002_initial_data.py | 91 +++++++++++++++++++ .../migrations/0002_initial_data.py | 52 +++++++++++ .../migrations/0002_initial_data.py | 52 +++++++++++ 5 files changed, 236 insertions(+) create mode 100644 wagtail/wagtailadmin/migrations/0001_create_admin_access_permissions.py create mode 100644 wagtail/wagtailadmin/migrations/__init__.py create mode 100644 wagtail/wagtailcore/migrations/0002_initial_data.py create mode 100644 wagtail/wagtaildocs/migrations/0002_initial_data.py create mode 100644 wagtail/wagtailimages/migrations/0002_initial_data.py diff --git a/wagtail/wagtailadmin/migrations/0001_create_admin_access_permissions.py b/wagtail/wagtailadmin/migrations/0001_create_admin_access_permissions.py new file mode 100644 index 000000000..5f198a01d --- /dev/null +++ b/wagtail/wagtailadmin/migrations/0001_create_admin_access_permissions.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +def create_admin_access_permissions(apps, schema_editor): + ContentType = apps.get_model('contenttypes.ContentType') + Permission = apps.get_model('auth.Permission') + Group = apps.get_model('auth.Group') + + # Add a fake content type to hang the 'can access Wagtail admin' permission off. + # The fact that this doesn't correspond to an actual defined model shouldn't matter, I hope... + wagtailadmin_content_type = ContentType.objects.create( + app_label='wagtailadmin', + model='admin', + name='Wagtail admin' + ) + + # Create admin permission + admin_permission = Permission.objects.create( + content_type=wagtailadmin_content_type, + codename='access_admin', + name='Can access Wagtail admin' + ) + + # Assign it to Editors and Moderators groups + for group in Group.objects.filter(name__in=['Editors', 'Moderators']): + group.permissions.add(admin_permission) + + +class Migration(migrations.Migration): + + dependencies = [ + # Need to run wagtailcores initial data migration to make sure the groups are created + ('wagtailcore', '0002_initial_data'), + ] + + operations = [ + migrations.RunPython(create_admin_access_permissions), + ] diff --git a/wagtail/wagtailadmin/migrations/__init__.py b/wagtail/wagtailadmin/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wagtail/wagtailcore/migrations/0002_initial_data.py b/wagtail/wagtailcore/migrations/0002_initial_data.py new file mode 100644 index 000000000..10244c24c --- /dev/null +++ b/wagtail/wagtailcore/migrations/0002_initial_data.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +def initial_data(apps, schema_editor): + ContentType = apps.get_model('contenttypes.ContentType') + Group = apps.get_model('auth.Group') + Page = apps.get_model('wagtailcore.Page') + Site = apps.get_model('wagtailcore.Site') + GroupPagePermission = apps.get_model('wagtailcore.GroupPagePermission') + + # Create page content type + page_content_type, created = ContentType.objects.get_or_create( + model='page', + app_label='wagtailcore', + defaults={'name': 'page'} + ) + + # Create root page + root = Page.objects.create( + title="Root", + slug='root', + content_type=page_content_type, + path='0001', + depth=1, + numchild=1, + url_path='/', + ) + + # Create homepage + homepage = Page.objects.create( + title="Welcome to your new Wagtail site!", + slug='home', + content_type=page_content_type, + path='00010001', + depth=2, + numchild=0, + url_path='/home/', + ) + + # Create default site + Site.objects.create( + hostname='localhost', + root_page_id=homepage.id, + is_default_site=True + ) + + # Create auth groups + moderators_group = Group.objects.create(name='Moderators') + editors_group = Group.objects.create(name='Editors') + + # Create group permissions + GroupPagePermission.objects.create( + group=moderators_group, + page=root, + permission_type='add', + ) + GroupPagePermission.objects.create( + group=moderators_group, + page=root, + permission_type='edit', + ) + GroupPagePermission.objects.create( + group=moderators_group, + page=root, + permission_type='publish', + ) + + GroupPagePermission.objects.create( + group=editors_group, + page=root, + permission_type='add', + ) + GroupPagePermission.objects.create( + group=editors_group, + page=root, + permission_type='edit', + ) + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0001_initial'), + ] + + operations = [ + migrations.RunPython(initial_data), + ] diff --git a/wagtail/wagtaildocs/migrations/0002_initial_data.py b/wagtail/wagtaildocs/migrations/0002_initial_data.py new file mode 100644 index 000000000..6ca3a0fbd --- /dev/null +++ b/wagtail/wagtaildocs/migrations/0002_initial_data.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +def add_document_permissions_to_admin_groups(apps, schema_editor): + ContentType = apps.get_model('contenttypes.ContentType') + Permission = apps.get_model('auth.Permission') + Group = apps.get_model('auth.Group') + Document = apps.get_model('wagtaildocs.Document') + + # Get document permissions + document_content_type, _created = ContentType.objects.get_or_create( + model='document', + app_label='wagtaildocs', + defaults={'name': 'document'} + ) + + add_document_permission, _created = Permission.objects.get_or_create( + content_type=document_content_type, + codename='add_document', + defaults={'name': 'Can add document'} + ) + change_document_permission, _created = Permission.objects.get_or_create( + content_type=document_content_type, + codename='change_document', + defaults={'name': 'Can change document'} + ) + delete_document_permission, _created = Permission.objects.get_or_create( + content_type=document_content_type, + codename='delete_document', + defaults={'name': 'Can delete document'} + ) + + # Assign it to Editors and Moderators groups + for group in Group.objects.filter(name__in=['Editors', 'Moderators']): + group.permissions.add(add_document_permission, change_document_permission, delete_document_permission) + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtaildocs', '0001_initial'), + + # Need to run wagtailcores initial data migration to make sure the groups are created + ('wagtailcore', '0002_initial_data'), + ] + + operations = [ + migrations.RunPython(add_document_permissions_to_admin_groups), + ] diff --git a/wagtail/wagtailimages/migrations/0002_initial_data.py b/wagtail/wagtailimages/migrations/0002_initial_data.py new file mode 100644 index 000000000..7451ba7d7 --- /dev/null +++ b/wagtail/wagtailimages/migrations/0002_initial_data.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +def add_image_permissions_to_admin_groups(apps, schema_editor): + ContentType = apps.get_model('contenttypes.ContentType') + Permission = apps.get_model('auth.Permission') + Group = apps.get_model('auth.Group') + Image = apps.get_model('wagtailimages.Image') + + # Get image permissions + image_content_type, _created = ContentType.objects.get_or_create( + model='image', + app_label='wagtailimages', + defaults={'name': 'image'} + ) + + add_image_permission, _created = Permission.objects.get_or_create( + content_type=image_content_type, + codename='add_image', + defaults={'name': 'Can add image'} + ) + change_image_permission, _created = Permission.objects.get_or_create( + content_type=image_content_type, + codename='change_image', + defaults={'name': 'Can change image'} + ) + delete_image_permission, _created = Permission.objects.get_or_create( + content_type=image_content_type, + codename='delete_image', + defaults={'name': 'Can delete image'} + ) + + # Assign it to Editors and Moderators groups + for group in Group.objects.filter(name__in=['Editors', 'Moderators']): + group.permissions.add(add_image_permission, change_image_permission, delete_image_permission) + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0001_initial'), + + # Need to run wagtailcores initial data migration to make sure the groups are created + ('wagtailcore', '0002_initial_data'), + ] + + operations = [ + migrations.RunPython(add_image_permissions_to_admin_groups), + ] From 0e2b621d39b3b54725d92ae20ad755f486a3a2a3 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 13:12:01 +0100 Subject: [PATCH 10/66] Added Django 1.7 support into Elasticsearch query building --- .../wagtailsearch/backends/elasticsearch.py | 219 ++++++++++-------- 1 file changed, 120 insertions(+), 99 deletions(-) diff --git a/wagtail/wagtailsearch/backends/elasticsearch.py b/wagtail/wagtailsearch/backends/elasticsearch.py index 8f8a78dbb..9e0d9b612 100644 --- a/wagtail/wagtailsearch/backends/elasticsearch.py +++ b/wagtail/wagtailsearch/backends/elasticsearch.py @@ -5,7 +5,13 @@ import json from six.moves.urllib.parse import urlparse from django.db import models -from django.db.models.sql.where import SubqueryConstraint +from django.db.models.sql.where import SubqueryConstraint, WhereNode + +# Django 1.7 lookups +try: + from django.db.models.lookups import Lookup +except ImportError: + Lookup = None from elasticsearch import Elasticsearch, NotFoundError, RequestError from elasticsearch.helpers import bulk @@ -125,118 +131,133 @@ class ElasticSearchQuery(object): self.query_string = query_string self.fields = fields + def _process_lookup(self, field_attname, lookup, value): + # Get field + field = dict( + (field.get_attname(self.queryset.model), field) + for field in self.queryset.model.get_filterable_search_fields() + ).get(field_attname, None) + + # Give error if the field doesn't exist + if field is None: + raise FieldError('Cannot filter ElasticSearch results with field "' + field_name + '". Please add FilterField(\'' + field_name + '\') to ' + self.queryset.model.__name__ + '.search_fields.') + + # Get the name of the field in the index + field_index_name = field.get_index_name(self.queryset.model) + + if lookup == 'exact': + if value is None: + return { + 'missing': { + 'field': field_index_name, + } + } + else: + return { + 'term': { + field_index_name: value, + } + } + + if lookup == 'isnull': + if value: + return { + 'missing': { + 'field': field_index_name, + } + } + else: + return { + 'not': { + 'missing': { + 'field': field_index_name, + } + } + } + + if lookup in ['startswith', 'prefix']: + return { + 'prefix': { + field_index_name: value, + } + } + + if lookup in ['gt', 'gte', 'lt', 'lte']: + return { + 'range': { + field_index_name: { + lookup: value, + } + } + } + + if lookup == 'range': + lower, upper = value + + return { + 'range': { + field_index_name: { + 'gte': lower, + 'lte': upper, + } + } + } + + if lookup == 'in': + return { + 'terms': { + field_index_name: value, + } + } + + raise FilterError('Could not apply filter on ElasticSearch results: "' + field_name + '__' + lookup + ' = ' + unicode(value) + '". Lookup "' + lookup + '"" not recognosed.') + def _get_filters_from_where(self, where_node): # Check if this is a leaf node - if isinstance(where_node, tuple): - field_name = where_node[0].col + if isinstance(where_node, tuple): # Django 1.6 and below + field_attname = where_node[0].col lookup = where_node[1] value = where_node[3] - # Get field - field = dict( - (field.get_attname(self.queryset.model), field) - for field in self.queryset.model.get_filterable_search_fields() - ).get(field_name, None) + # Process the filter + return self._process_lookup(field_attname, lookup, value) - # Give error if the field doesn't exist - if field is None: - raise FieldError('Cannot filter ElasticSearch results with field "' + field_name + '". Please add FilterField(\'' + field_name + '\') to ' + self.queryset.model.__name__ + '.search_fields.') + elif Lookup is not None and isinstance(where_node, Lookup): # Django 1.7 and above + field_attname = where_node.lhs.target.attname + lookup = where_node.lookup_name + value = where_node.rhs - # Get the name of the field in the index - field_index_name = field.get_index_name(self.queryset.model) + # Process the filter + return self._process_lookup(field_attname, lookup, value) - # Find lookup - if lookup == 'exact': - if value is None: - return { - 'missing': { - 'field': field_index_name, - } - } - else: - return { - 'term': { - field_index_name: value, - } - } - - if lookup == 'isnull': - if value: - return { - 'missing': { - 'field': field_index_name, - } - } - else: - return { - 'not': { - 'missing': { - 'field': field_index_name, - } - } - } - - if lookup in ['startswith', 'prefix']: - return { - 'prefix': { - field_index_name: value, - } - } - - if lookup in ['gt', 'gte', 'lt', 'lte']: - return { - 'range': { - field_index_name: { - lookup: value, - } - } - } - - if lookup == 'range': - lower, upper = value - - return { - 'range': { - field_index_name: { - 'gte': lower, - 'lte': upper, - } - } - } - - if lookup == 'in': - return { - 'terms': { - field_index_name: value, - } - } - - raise FilterError('Could not apply filter on ElasticSearch results: "' + field_name + '__' + lookup + ' = ' + unicode(value) + '". Lookup "' + lookup + '"" not recognosed.') elif isinstance(where_node, SubqueryConstraint): raise FilterError('Could not apply filter on ElasticSearch results: Subqueries are not allowed.') - # Get child filters - connector = where_node.connector - child_filters = [self._get_filters_from_where(child) for child in where_node.children] - child_filters = [child_filter for child_filter in child_filters if child_filter] + elif isinstance(where_node, WhereNode): + # Get child filters + connector = where_node.connector + child_filters = [self._get_filters_from_where(child) for child in where_node.children] + child_filters = [child_filter for child_filter in child_filters if child_filter] - # Connect them - if child_filters: - if len(child_filters) == 1: - filter_out = child_filters[0] - else: - filter_out = { - connector.lower(): [ - fil for fil in child_filters if fil is not None - ] - } + # Connect them + if child_filters: + if len(child_filters) == 1: + filter_out = child_filters[0] + else: + filter_out = { + connector.lower(): [ + fil for fil in child_filters if fil is not None + ] + } - if where_node.negated: - filter_out = { - 'not': filter_out - } + if where_node.negated: + filter_out = { + 'not': filter_out + } - return filter_out + return filter_out + else: + raise FilterError('Could not apply filter on ElasticSearch results: Unknown where node: ' + str(type(where_node))) def _get_filters(self): # Filters From b7901aa026fe15b98ba3ab0e8799f8b50878485a Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 13:16:11 +0100 Subject: [PATCH 11/66] Fixed test failure --- wagtail/tests/settings.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wagtail/tests/settings.py b/wagtail/tests/settings.py index 444baca65..32426dba6 100644 --- a/wagtail/tests/settings.py +++ b/wagtail/tests/settings.py @@ -81,6 +81,13 @@ if django.VERSION[:2] == (1, 6): INSTALLED_APPS.append('south') +# As we don't have south migrations for tests, South thinks +# the Django 1.7 migrations are South migrations. +SOUTH_MIGRATION_MODULES = { + 'tests': 'ignore', +} + + # Using DatabaseCache to make sure that the cache is cleared between tests. # This prevents false-positives in some wagtail core tests where we are # changing the 'wagtail_root_paths' key which may cause future tests to fail. From d817396e2bc0bdf55552906b10a8aa0b14acdf9a Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 13:17:46 +0100 Subject: [PATCH 12/66] Allow Django 1.7 to be installed in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b591bbc71..bf9a35500 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ PY3 = sys.version_info[0] == 3 install_requires = [ - "Django>=1.6.2,<1.7", + "Django>=1.6.2,<1.8", "South==1.0.0", "django-compressor>=1.4", "django-libsass>=0.2", From a7afdd52aab8675f72979c54d8d233bebc48f616 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 13:36:03 +0100 Subject: [PATCH 13/66] Catch LookupError when finding target model in PageChooserPanel --- wagtail/wagtailadmin/edit_handlers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wagtail/wagtailadmin/edit_handlers.py b/wagtail/wagtailadmin/edit_handlers.py index d2eb181c3..3e463523d 100644 --- a/wagtail/wagtailadmin/edit_handlers.py +++ b/wagtail/wagtailadmin/edit_handlers.py @@ -491,7 +491,11 @@ class BasePageChooserPanel(BaseChooserPanel): except ValueError: raise ImproperlyConfigured("The page_type passed to PageChooserPanel must be of the form 'app_label.model_name'") - page_type = get_model(app_label, model_name) + try: + page_type = get_model(app_label, model_name) + except LookupError: + page_type = None + if page_type is None: raise ImproperlyConfigured("PageChooserPanel refers to model '%s' that has not been installed" % cls.page_type) else: From 26171746921102a3fe2b328d7cae7fee529baf86 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 23 Jul 2014 14:48:42 +0100 Subject: [PATCH 14/66] Don't ignore DeprecationWarnings This was previously done for us in Django 1.6. But they reverted back to the default Python configuration to ignore these warnings causing a test to break https://github.com/django/django/commit/0c6a3399523d850cfbd20de54cd089419a47383d --- runtests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtests.py b/runtests.py index 3a7399233..7961d2e19 100755 --- a/runtests.py +++ b/runtests.py @@ -2,6 +2,7 @@ import sys import os import shutil +import warnings from django.core.management import execute_from_command_line @@ -12,6 +13,9 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'wagtail.tests.settings' def runtests(): + # Don't ignore DeprecationWarnings + warnings.simplefilter('default', DeprecationWarning) + argv = sys.argv[:1] + ['test'] + sys.argv[1:] try: execute_from_command_line(argv) From 10217a9e1840f65ea75a4047c02d3d4d19a327a6 Mon Sep 17 00:00:00 2001 From: Tom Talbot Date: Mon, 28 Jul 2014 10:05:58 +0100 Subject: [PATCH 15/66] Fixed broken edit handlers test --- .../wagtailadmin/tests/test_edit_handlers.py | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/wagtail/wagtailadmin/tests/test_edit_handlers.py b/wagtail/wagtailadmin/tests/test_edit_handlers.py index 0dd699ac1..eaedccc2c 100644 --- a/wagtail/wagtailadmin/tests/test_edit_handlers.py +++ b/wagtail/wagtailadmin/tests/test_edit_handlers.py @@ -343,11 +343,27 @@ class TestInlinePanel(TestCase): fake_page = self.FakePage() self.barbecue = fake_page + class FakePanel(object): + name = 'mock panel' + + class FakeChild(object): + def render_js(self): + return "rendered js" + + def rendered_fields(self): + return ["rendered fields"] + + def init(*args, **kwargs): + pass + + def __call__(self, *args, **kwargs): + fake_child = self.FakeChild() + return fake_child + def setUp(self): self.fake_field = self.FakeField() self.fake_instance = self.FakeInstance() - self.mock_panel = MagicMock() - self.mock_panel.name = 'mock panel' + self.mock_panel = self.FakePanel() self.mock_model = MagicMock() self.mock_model.formset.related.model.panels = [self.mock_panel] From 8423c557be7c0bd46494291009fb2ccc69d68f76 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 28 Jul 2014 13:29:03 +0100 Subject: [PATCH 16/66] Added AppConfig classes for all modules --- wagtail/contrib/wagtailfrontendcache/__init__.py | 1 + wagtail/contrib/wagtailfrontendcache/apps.py | 7 +++++++ wagtail/contrib/wagtailmedusa/__init__.py | 1 + wagtail/contrib/wagtailmedusa/apps.py | 7 +++++++ wagtail/contrib/wagtailroutablepage/__init__.py | 1 + wagtail/contrib/wagtailroutablepage/apps.py | 7 +++++++ wagtail/contrib/wagtailsitemaps/__init__.py | 1 + wagtail/contrib/wagtailsitemaps/apps.py | 7 +++++++ wagtail/contrib/wagtailstyleguide/__init__.py | 1 + wagtail/contrib/wagtailstyleguide/apps.py | 7 +++++++ wagtail/wagtailadmin/__init__.py | 1 + wagtail/wagtailadmin/apps.py | 7 +++++++ wagtail/wagtailcore/__init__.py | 1 + wagtail/wagtailcore/apps.py | 7 +++++++ wagtail/wagtaildocs/__init__.py | 1 + wagtail/wagtaildocs/apps.py | 7 +++++++ wagtail/wagtailembeds/__init__.py | 2 ++ wagtail/wagtailembeds/apps.py | 7 +++++++ wagtail/wagtailforms/__init__.py | 1 + wagtail/wagtailforms/apps.py | 7 +++++++ wagtail/wagtailimages/__init__.py | 1 + wagtail/wagtailimages/apps.py | 7 +++++++ wagtail/wagtailredirects/__init__.py | 1 + wagtail/wagtailredirects/apps.py | 7 +++++++ wagtail/wagtailsearch/__init__.py | 4 +++- wagtail/wagtailsearch/apps.py | 7 +++++++ wagtail/wagtailsnippets/__init__.py | 1 + wagtail/wagtailsnippets/apps.py | 7 +++++++ wagtail/wagtailusers/__init__.py | 1 + wagtail/wagtailusers/apps.py | 7 +++++++ 30 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 wagtail/contrib/wagtailfrontendcache/apps.py create mode 100644 wagtail/contrib/wagtailmedusa/apps.py create mode 100644 wagtail/contrib/wagtailroutablepage/apps.py create mode 100644 wagtail/contrib/wagtailsitemaps/apps.py create mode 100644 wagtail/contrib/wagtailstyleguide/apps.py create mode 100644 wagtail/wagtailadmin/apps.py create mode 100644 wagtail/wagtailcore/apps.py create mode 100644 wagtail/wagtaildocs/apps.py create mode 100644 wagtail/wagtailembeds/apps.py create mode 100644 wagtail/wagtailforms/apps.py create mode 100644 wagtail/wagtailimages/apps.py create mode 100644 wagtail/wagtailredirects/apps.py create mode 100644 wagtail/wagtailsearch/apps.py create mode 100644 wagtail/wagtailsnippets/apps.py create mode 100644 wagtail/wagtailusers/apps.py diff --git a/wagtail/contrib/wagtailfrontendcache/__init__.py b/wagtail/contrib/wagtailfrontendcache/__init__.py index e69de29bb..2cd2d60cb 100644 --- a/wagtail/contrib/wagtailfrontendcache/__init__.py +++ b/wagtail/contrib/wagtailfrontendcache/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.contrib.wagtailfrontendcache.apps.WagtailFrontendCacheAppConfig' diff --git a/wagtail/contrib/wagtailfrontendcache/apps.py b/wagtail/contrib/wagtailfrontendcache/apps.py new file mode 100644 index 000000000..2fa34a0da --- /dev/null +++ b/wagtail/contrib/wagtailfrontendcache/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailFrontendCacheAppConfig(AppConfig): + name = 'wagtail.contrib.wagtailfrontendcache' + label = 'wagtailfrontendcache' + verbose_name = "Wagtail frontend cache" diff --git a/wagtail/contrib/wagtailmedusa/__init__.py b/wagtail/contrib/wagtailmedusa/__init__.py index e69de29bb..5d5f8ce96 100644 --- a/wagtail/contrib/wagtailmedusa/__init__.py +++ b/wagtail/contrib/wagtailmedusa/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.contrib.wagtailmedusa.apps.WagtailMedusaAppConfig' diff --git a/wagtail/contrib/wagtailmedusa/apps.py b/wagtail/contrib/wagtailmedusa/apps.py new file mode 100644 index 000000000..46143d137 --- /dev/null +++ b/wagtail/contrib/wagtailmedusa/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailMedusaAppConfig(AppConfig): + name = 'wagtail.contrib.wagtailmedusa' + label = 'wagtailmedusa' + verbose_name = "Wagtail medusa" diff --git a/wagtail/contrib/wagtailroutablepage/__init__.py b/wagtail/contrib/wagtailroutablepage/__init__.py index e69de29bb..286151ff0 100644 --- a/wagtail/contrib/wagtailroutablepage/__init__.py +++ b/wagtail/contrib/wagtailroutablepage/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.contrib.wagtailroutablepage.apps.WagtailRoutablePageAppConfig' diff --git a/wagtail/contrib/wagtailroutablepage/apps.py b/wagtail/contrib/wagtailroutablepage/apps.py new file mode 100644 index 000000000..c3b9c9573 --- /dev/null +++ b/wagtail/contrib/wagtailroutablepage/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailRoutablePageAppConfig(AppConfig): + name = 'wagtail.contrib.wagtailroutablepage' + label = 'wagtailroutablepage' + verbose_name = "Wagtail routablepage" diff --git a/wagtail/contrib/wagtailsitemaps/__init__.py b/wagtail/contrib/wagtailsitemaps/__init__.py index e69de29bb..e647b7be1 100644 --- a/wagtail/contrib/wagtailsitemaps/__init__.py +++ b/wagtail/contrib/wagtailsitemaps/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.contrib.wagtailsitemaps.apps.WagtailSitemapsAppConfig' diff --git a/wagtail/contrib/wagtailsitemaps/apps.py b/wagtail/contrib/wagtailsitemaps/apps.py new file mode 100644 index 000000000..d8b249a2a --- /dev/null +++ b/wagtail/contrib/wagtailsitemaps/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailSitemapsAppConfig(AppConfig): + name = 'wagtail.contrib.wagtailsitemaps' + label = 'wagtailsitemaps' + verbose_name = "Wagtail sitemaps" diff --git a/wagtail/contrib/wagtailstyleguide/__init__.py b/wagtail/contrib/wagtailstyleguide/__init__.py index e69de29bb..18ff63cfe 100644 --- a/wagtail/contrib/wagtailstyleguide/__init__.py +++ b/wagtail/contrib/wagtailstyleguide/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.contrib.wagtailstyleguide.apps.WagtailStyleGuideAppConfig' diff --git a/wagtail/contrib/wagtailstyleguide/apps.py b/wagtail/contrib/wagtailstyleguide/apps.py new file mode 100644 index 000000000..093003ac8 --- /dev/null +++ b/wagtail/contrib/wagtailstyleguide/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailStyleGuideAppConfig(AppConfig): + name = 'wagtail.contrib.wagtailstyleguide' + label = 'wagtailstyleguide' + verbose_name = "Wagtail style guide" diff --git a/wagtail/wagtailadmin/__init__.py b/wagtail/wagtailadmin/__init__.py index e69de29bb..c0779fd93 100644 --- a/wagtail/wagtailadmin/__init__.py +++ b/wagtail/wagtailadmin/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtailadmin.apps.WagtailAdminAppConfig' diff --git a/wagtail/wagtailadmin/apps.py b/wagtail/wagtailadmin/apps.py new file mode 100644 index 000000000..c963dadef --- /dev/null +++ b/wagtail/wagtailadmin/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailAdminAppConfig(AppConfig): + name = 'wagtail.wagtailadmin' + label = 'wagtailadmin' + verbose_name = "Wagtail admin" diff --git a/wagtail/wagtailcore/__init__.py b/wagtail/wagtailcore/__init__.py index e69de29bb..160f57430 100644 --- a/wagtail/wagtailcore/__init__.py +++ b/wagtail/wagtailcore/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtailcore.apps.WagtailCoreAppConfig' diff --git a/wagtail/wagtailcore/apps.py b/wagtail/wagtailcore/apps.py new file mode 100644 index 000000000..b4ef506dc --- /dev/null +++ b/wagtail/wagtailcore/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailCoreAppConfig(AppConfig): + name = 'wagtail.wagtailcore' + label = 'wagtailcore' + verbose_name = "Wagtail core" diff --git a/wagtail/wagtaildocs/__init__.py b/wagtail/wagtaildocs/__init__.py index e69de29bb..9c5f85240 100644 --- a/wagtail/wagtaildocs/__init__.py +++ b/wagtail/wagtaildocs/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtaildocs.apps.WagtailDocsAppConfig' diff --git a/wagtail/wagtaildocs/apps.py b/wagtail/wagtaildocs/apps.py new file mode 100644 index 000000000..eef820d18 --- /dev/null +++ b/wagtail/wagtaildocs/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailDocsAppConfig(AppConfig): + name = 'wagtail.wagtaildocs' + label = 'wagtaildocs' + verbose_name = "Wagtail documents" diff --git a/wagtail/wagtailembeds/__init__.py b/wagtail/wagtailembeds/__init__.py index b75cbc491..54d955608 100644 --- a/wagtail/wagtailembeds/__init__.py +++ b/wagtail/wagtailembeds/__init__.py @@ -1,2 +1,4 @@ from .models import Embed from .embeds import get_embed + +default_app_config = 'wagtail.wagtailembeds.apps.WagtailEmbedsAppConfig' diff --git a/wagtail/wagtailembeds/apps.py b/wagtail/wagtailembeds/apps.py new file mode 100644 index 000000000..ecbaf6cb5 --- /dev/null +++ b/wagtail/wagtailembeds/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailEmbedsAppConfig(AppConfig): + name = 'wagtail.wagtailembeds' + label = 'wagtailembeds' + verbose_name = "Wagtail embeds" diff --git a/wagtail/wagtailforms/__init__.py b/wagtail/wagtailforms/__init__.py index e69de29bb..7be37b5f1 100644 --- a/wagtail/wagtailforms/__init__.py +++ b/wagtail/wagtailforms/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtailforms.apps.WagtailFormsAppConfig' diff --git a/wagtail/wagtailforms/apps.py b/wagtail/wagtailforms/apps.py new file mode 100644 index 000000000..7336f20e0 --- /dev/null +++ b/wagtail/wagtailforms/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailFormsAppConfig(AppConfig): + name = 'wagtail.wagtailforms' + label = 'wagtailforms' + verbose_name = "Wagtail forms" diff --git a/wagtail/wagtailimages/__init__.py b/wagtail/wagtailimages/__init__.py index e69de29bb..61397a911 100644 --- a/wagtail/wagtailimages/__init__.py +++ b/wagtail/wagtailimages/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtailimages.apps.WagtailImagesAppConfig' diff --git a/wagtail/wagtailimages/apps.py b/wagtail/wagtailimages/apps.py new file mode 100644 index 000000000..88cd6e3f0 --- /dev/null +++ b/wagtail/wagtailimages/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailImagesAppConfig(AppConfig): + name = 'wagtail.wagtailimages' + label = 'wagtailimages' + verbose_name = "Wagtail images" diff --git a/wagtail/wagtailredirects/__init__.py b/wagtail/wagtailredirects/__init__.py index e69de29bb..b192b1b24 100644 --- a/wagtail/wagtailredirects/__init__.py +++ b/wagtail/wagtailredirects/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtailredirects.apps.WagtailRedirectsAppConfig' diff --git a/wagtail/wagtailredirects/apps.py b/wagtail/wagtailredirects/apps.py new file mode 100644 index 000000000..400299f02 --- /dev/null +++ b/wagtail/wagtailredirects/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailRedirectsAppConfig(AppConfig): + name = 'wagtail.wagtailredirects' + label = 'wagtailredirects' + verbose_name = "Wagtail redirects" diff --git a/wagtail/wagtailsearch/__init__.py b/wagtail/wagtailsearch/__init__.py index ed896f445..8f53f7c4a 100644 --- a/wagtail/wagtailsearch/__init__.py +++ b/wagtail/wagtailsearch/__init__.py @@ -1,3 +1,5 @@ from wagtail.wagtailsearch.indexed import Indexed from wagtail.wagtailsearch.signal_handlers import register_signal_handlers -from wagtail.wagtailsearch.backends import get_search_backend \ No newline at end of file +from wagtail.wagtailsearch.backends import get_search_backend + +default_app_config = 'wagtail.wagtailsearch.apps.WagtailSearchAppConfig' diff --git a/wagtail/wagtailsearch/apps.py b/wagtail/wagtailsearch/apps.py new file mode 100644 index 000000000..e3b07c721 --- /dev/null +++ b/wagtail/wagtailsearch/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailSearchAppConfig(AppConfig): + name = 'wagtail.wagtailsearch' + label = 'wagtailsearch' + verbose_name = "Wagtail search" diff --git a/wagtail/wagtailsnippets/__init__.py b/wagtail/wagtailsnippets/__init__.py index e69de29bb..4b8d21cd7 100644 --- a/wagtail/wagtailsnippets/__init__.py +++ b/wagtail/wagtailsnippets/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtailsnippets.apps.WagtailSnippetsAppConfig' diff --git a/wagtail/wagtailsnippets/apps.py b/wagtail/wagtailsnippets/apps.py new file mode 100644 index 000000000..f63d40759 --- /dev/null +++ b/wagtail/wagtailsnippets/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailSnippetsAppConfig(AppConfig): + name = 'wagtail.wagtailsnippets' + label = 'wagtailsnippets' + verbose_name = "Wagtail snippets" diff --git a/wagtail/wagtailusers/__init__.py b/wagtail/wagtailusers/__init__.py index e69de29bb..088b3cb69 100644 --- a/wagtail/wagtailusers/__init__.py +++ b/wagtail/wagtailusers/__init__.py @@ -0,0 +1 @@ +default_app_config = 'wagtail.wagtailusers.apps.WagtailUsersAppConfig' diff --git a/wagtail/wagtailusers/apps.py b/wagtail/wagtailusers/apps.py new file mode 100644 index 000000000..055e18d99 --- /dev/null +++ b/wagtail/wagtailusers/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class WagtailUsersAppConfig(AppConfig): + name = 'wagtail.wagtailusers' + label = 'wagtailusers' + verbose_name = "Wagtail users" From 43ebd845b698351f93fd54373396bea50d2948c3 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 28 Jul 2014 15:01:21 +0100 Subject: [PATCH 17/66] Added Django 1.7 to tox settings. Use tox on travis --- .travis.yml | 31 +++++++---- tox.ini | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 170 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 326c22d01..f54d1392e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,38 @@ language: python -# Test matrix -python: - - 2.7 - - 3.2 - - 3.4 env: - - DJANGO_VERSION=Django==1.6.5 - #- DJANGO_VERSION=Django==1.7.0 +# - TOXENV=py26-dj16-postgres + - TOXENV=py26-dj16-sqlite + - TOXENV=py27-dj16-postgres +# - TOXENV=py27-dj16-sqlite + - TOXENV=py32-dj16-postgres +# - TOXENV=py33-dj16-postgres + - TOXENV=py34-dj16-postgres + - TOXENV=py27-dj17-postgres +# - TOXENV=py27-dj17-sqlite +# - TOXENV=py32-dj17-postgres +# - TOXENV=py33-dj17-postgres + - TOXENV=py34-dj17-postgres + # Services services: - redis-server - elasticsearch + # Package installation install: - - python setup.py install - - pip install psycopg2 elasticsearch wand embedly - - pip install coveralls + - pip install tox coveralls + # Pre-test configuration before_script: - psql -c 'create database wagtaildemo;' -U postgres + # Run the tests script: - coverage run runtests.py + tox + after_success: coveralls + # Who to notify about build results notifications: email: diff --git a/tox.ini b/tox.ini index 2b17c65ba..30632a221 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,39 @@ [deps] -dj16= - Django>=1.6,<1.7 +base = + South==1.0.0 + django-compressor>=1.4 + django-libsass>=0.2 + django-modelcluster>=0.3 + django-taggit==0.12.0 + django-treebeard==2.0 + Pillow>=2.3.0 + beautifulsoup4>=4.3.2 + html5lib==0.999 + Unidecode>=0.04.14 + six==1.7.3 + requests==2.3.0 elasticsearch==1.1.0 mock==1.0.1 + Embedly + coverage + +dj16 = + Django>=1.6,<1.7 + + +dj17 = + https://github.com/django/django/archive/stable/1.7.x.zip#egg=django + +py2 = + unicodecsv>=0.9.4 + +py3 = + [tox] +skipsdist = True +usedevelop = True + envlist = py26-dj16-postgres, py26-dj16-sqlite, @@ -12,7 +41,13 @@ envlist = py27-dj16-sqlite, py32-dj16-postgres, py33-dj16-postgres, - py34-dj16-postgres + py34-dj16-postgres, + + py27-dj17-postgres, + py27-dj17-sqlite, + py32-dj17-postgres, + py33-dj17-postgres, + py34-dj17-postgres # mysql not currently supported # (wagtail.wagtailimages.tests.TestImageEditView currently fails with a @@ -27,11 +62,13 @@ envlist = [testenv] -commands=./runtests.py +commands=coverage run runtests.py [testenv:py26-dj16-postgres] basepython=python2.6 deps = + {[deps]base} + {[deps]py2} {[deps]dj16} psycopg2==2.5.3 setenv = @@ -40,6 +77,8 @@ setenv = [testenv:py26-dj16-sqlite] basepython=python2.6 deps = + {[deps]base} + {[deps]py2} {[deps]dj16} setenv = DATABASE_ENGINE=django.db.backends.sqlite3 @@ -47,6 +86,8 @@ setenv = [testenv:py26-dj16-mysql] basepython=python2.6 deps = + {[deps]base} + {[deps]py2} {[deps]dj16} MySQL-python==1.2.5 setenv = @@ -56,6 +97,8 @@ setenv = [testenv:py27-dj16-postgres] basepython=python2.7 deps = + {[deps]base} + {[deps]py2} {[deps]dj16} psycopg2==2.5.3 setenv = @@ -64,6 +107,8 @@ setenv = [testenv:py27-dj16-sqlite] basepython=python2.7 deps = + {[deps]base} + {[deps]py2} {[deps]dj16} setenv = DATABASE_ENGINE=django.db.backends.sqlite3 @@ -71,6 +116,8 @@ setenv = [testenv:py27-dj16-mysql] basepython=python2.7 deps = + {[deps]base} + {[deps]py2} {[deps]dj16} MySQL-python==1.2.5 setenv = @@ -80,6 +127,8 @@ setenv = [testenv:py32-dj16-postgres] basepython=python3.2 deps = + {[deps]base} + {[deps]py3} {[deps]dj16} psycopg2==2.5.3 setenv = @@ -88,6 +137,8 @@ setenv = [testenv:py32-dj16-sqlite] basepython=python3.2 deps = + {[deps]base} + {[deps]py3} {[deps]dj16} setenv = DATABASE_ENGINE=django.db.backends.sqlite3 @@ -95,6 +146,8 @@ setenv = [testenv:py33-dj16-postgres] basepython=python3.3 deps = + {[deps]base} + {[deps]py3} {[deps]dj16} psycopg2==2.5.3 setenv = @@ -103,6 +156,8 @@ setenv = [testenv:py33-dj16-sqlite] basepython=python3.3 deps = + {[deps]base} + {[deps]py3} {[deps]dj16} setenv = DATABASE_ENGINE=django.db.backends.sqlite3 @@ -110,6 +165,8 @@ setenv = [testenv:py34-dj16-postgres] basepython=python3.4 deps = + {[deps]base} + {[deps]py3} {[deps]dj16} psycopg2==2.5.3 setenv = @@ -118,6 +175,95 @@ setenv = [testenv:py34-dj16-sqlite] basepython=python3.4 deps = + {[deps]base} + {[deps]py3} {[deps]dj16} setenv = DATABASE_ENGINE=django.db.backends.sqlite3 + +[testenv:py27-dj17-postgres] +basepython=python2.7 +deps = + {[deps]base} + {[deps]py2} + {[deps]dj17} + psycopg2==2.5.3 +setenv = + DATABASE_ENGINE=django.db.backends.postgresql_psycopg2 + +[testenv:py27-dj17-sqlite] +basepython=python2.7 +deps = + {[deps]base} + {[deps]py2} + {[deps]dj17} +setenv = + DATABASE_ENGINE=django.db.backends.sqlite3 + +[testenv:py27-dj17-mysql] +basepython=python2.7 +deps = + {[deps]base} + {[deps]py2} + {[deps]dj17} + MySQL-python==1.2.5 +setenv = + DATABASE_ENGINE=django.db.backends.mysql + DATABASE_USER=wagtail + +[testenv:py32-dj17-postgres] +basepython=python3.2 +deps = + {[deps]base} + {[deps]py3} + {[deps]dj17} + psycopg2==2.5.3 +setenv = + DATABASE_ENGINE=django.db.backends.postgresql_psycopg2 + +[testenv:py32-dj17-sqlite] +basepython=python3.2 +deps = + {[deps]base} + {[deps]py3} + {[deps]dj17} +setenv = + DATABASE_ENGINE=django.db.backends.sqlite3 + +[testenv:py33-dj17-postgres] +basepython=python3.3 +deps = + {[deps]base} + {[deps]py3} + {[deps]dj17} + psycopg2==2.5.3 +setenv = + DATABASE_ENGINE=django.db.backends.postgresql_psycopg2 + +[testenv:py33-dj17-sqlite] +basepython=python3.3 +deps = + {[deps]base} + {[deps]py3} + {[deps]dj17} +setenv = + DATABASE_ENGINE=django.db.backends.sqlite3 + +[testenv:py34-dj17-postgres] +basepython=python3.4 +deps = + {[deps]base} + {[deps]py3} + {[deps]dj17} + psycopg2==2.5.3 +setenv = + DATABASE_ENGINE=django.db.backends.postgresql_psycopg2 + +[testenv:py34-dj17-sqlite] +basepython=python3.4 +deps = + {[deps]base} + {[deps]py3} + {[deps]dj17} +setenv = + DATABASE_ENGINE=django.db.backends.sqlite3 From 9501662ead4b616e8a2502c85c7cc388afca70aa Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 28 Jul 2014 16:37:46 +0100 Subject: [PATCH 18/66] Updated tests migrations --- wagtail/tests/migrations/0001_initial.py | 290 +-------------- .../migrations/0002_auto_20140728_1636.py | 341 ++++++++++++++++++ 2 files changed, 355 insertions(+), 276 deletions(-) create mode 100644 wagtail/tests/migrations/0002_auto_20140728_1636.py diff --git a/wagtail/tests/migrations/0001_initial.py b/wagtail/tests/migrations/0001_initial.py index 9b6592118..c1dd942f5 100644 --- a/wagtail/tests/migrations/0001_initial.py +++ b/wagtail/tests/migrations/0001_initial.py @@ -2,297 +2,35 @@ from __future__ import unicode_literals from django.db import models, migrations -import django.db.models.deletion -import wagtail.wagtailsearch.indexed -import modelcluster.fields -import wagtail.wagtailcore.fields +import django.utils.timezone class Migration(migrations.Migration): dependencies = [ - ('wagtailimages', '0001_initial'), - ('wagtailcore', '0001_initial'), - ('wagtaildocs', '__latest__'), + ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( - name='Advert', + name='CustomUser', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('url', models.URLField(null=True, blank=True)), - ('text', models.CharField(max_length=255)), - ], - options={ - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='AlphaSnippet', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('text', models.CharField(max_length=255)), - ], - options={ - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='BusinessChild', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('username', models.CharField(unique=True, max_length=100)), + ('email', models.EmailField(max_length=255, blank=True)), + ('is_staff', models.BooleanField(default=True)), + ('is_active', models.BooleanField(default=True)), + ('first_name', models.CharField(max_length=50, blank=True)), + ('last_name', models.CharField(max_length=50, blank=True)), + ('groups', models.ManyToManyField(to='auth.Group', verbose_name='groups', blank=True)), + ('user_permissions', models.ManyToManyField(to='auth.Permission', verbose_name='user permissions', blank=True)), ], options={ 'abstract': False, }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='BusinessIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='BusinessSubIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='EventIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='EventPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('date_from', models.DateField(null=True, verbose_name=b'Start date')), - ('date_to', models.DateField(help_text=b'Not required if event is on a single day', null=True, verbose_name=b'End date', blank=True)), - ('time_from', models.TimeField(null=True, verbose_name=b'Start time', blank=True)), - ('time_to', models.TimeField(null=True, verbose_name=b'End time', blank=True)), - ('audience', models.CharField(max_length=255, choices=[(b'public', b'Public'), (b'private', b'Private')])), - ('location', models.CharField(max_length=255)), - ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), - ('cost', models.CharField(max_length=255)), - ('signup_link', models.URLField(blank=True)), - ('feed_image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='EventPageCarouselItem', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('link_external', models.URLField(verbose_name=b'External link', blank=True)), - ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), - ('caption', models.CharField(max_length=255, blank=True)), - ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), - ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), - ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), - ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='EventPageRelatedLink', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('link_external', models.URLField(verbose_name=b'External link', blank=True)), - ('title', models.CharField(help_text=b'Link title', max_length=255)), - ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), - ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), - ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='EventPageSpeaker', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('link_external', models.URLField(verbose_name=b'External link', blank=True)), - ('first_name', models.CharField(max_length=255, verbose_name=b'Name', blank=True)), - ('last_name', models.CharField(max_length=255, verbose_name=b'Surname', blank=True)), - ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), - ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), - ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), - ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='FormField', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('label', models.CharField(help_text='The label of the form field', max_length=255)), - ('field_type', models.CharField(max_length=16, choices=[(b'singleline', 'Single line text'), (b'multiline', 'Multi-line text'), (b'email', 'Email'), (b'number', 'Number'), (b'url', 'URL'), (b'checkbox', 'Checkbox'), (b'checkboxes', 'Checkboxes'), (b'dropdown', 'Drop down'), (b'radio', 'Radio buttons'), (b'date', 'Date'), (b'datetime', 'Date/time')])), - ('required', models.BooleanField(default=True)), - ('choices', models.CharField(help_text='Comma seperated list of choices. Only applicable in checkboxes, radio and dropdown.', max_length=512, blank=True)), - ('default_value', models.CharField(help_text='Default value. Comma seperated values supported for checkboxes.', max_length=255, blank=True)), - ('help_text', models.CharField(max_length=255, blank=True)), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='FormPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('to_address', models.CharField(help_text='Optional - form submissions will be emailed to this address', max_length=255, blank=True)), - ('from_address', models.CharField(max_length=255, blank=True)), - ('subject', models.CharField(max_length=255, blank=True)), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.AddField( - model_name='formfield', - name='page', - field=modelcluster.fields.ParentalKey(to='tests.FormPage'), - preserve_default=True, - ), - migrations.CreateModel( - name='PageWithOldStyleRouteMethod', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('content', models.TextField()), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='RoutablePageTest', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='SearchTest', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('title', models.CharField(max_length=255)), - ('content', models.TextField()), - ('live', models.BooleanField(default=False)), - ('published_date', models.DateField(null=True)), - ], - options={ - }, - bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), - ), - migrations.CreateModel( - name='SearchTestChild', - fields=[ - ('searchtest_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='tests.SearchTest')), - ('subtitle', models.CharField(max_length=255, null=True, blank=True)), - ('extra_content', models.TextField()), - ], - options={ - }, - bases=('tests.searchtest',), - ), - migrations.CreateModel( - name='SearchTestOldConfig', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ], - options={ - }, - bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), - ), - migrations.CreateModel( - name='SearchTestOldConfigList', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ], - options={ - }, - bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), - ), - migrations.CreateModel( - name='SimplePage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('content', models.TextField()), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='StandardChild', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='StandardIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='ZuluSnippet', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('text', models.CharField(max_length=255)), - ], - options={ - }, bases=(models.Model,), ), ] diff --git a/wagtail/tests/migrations/0002_auto_20140728_1636.py b/wagtail/tests/migrations/0002_auto_20140728_1636.py new file mode 100644 index 000000000..9725c0ebc --- /dev/null +++ b/wagtail/tests/migrations/0002_auto_20140728_1636.py @@ -0,0 +1,341 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +import taggit.models +import wagtail.wagtailsearch.indexed +import modelcluster.fields +import wagtail.wagtailcore.fields +import modelcluster.tags +import wagtail.tests.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0002_initial_data'), + ('wagtaildocs', '0002_initial_data'), + ('wagtailimages', '0002_initial_data'), + ('taggit', '0001_initial'), + ('tests', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Advert', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('url', models.URLField(null=True, blank=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AlphaSnippet', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BusinessChild', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BusinessIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BusinessSubIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventPage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('date_from', models.DateField(null=True, verbose_name=b'Start date')), + ('date_to', models.DateField(help_text=b'Not required if event is on a single day', null=True, verbose_name=b'End date', blank=True)), + ('time_from', models.TimeField(null=True, verbose_name=b'Start time', blank=True)), + ('time_to', models.TimeField(null=True, verbose_name=b'End time', blank=True)), + ('audience', models.CharField(max_length=255, choices=[(b'public', b'Public'), (b'private', b'Private')])), + ('location', models.CharField(max_length=255)), + ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('cost', models.CharField(max_length=255)), + ('signup_link', models.URLField(blank=True)), + ('feed_image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventPageCarouselItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), + ('caption', models.CharField(max_length=255, blank=True)), + ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageSpeaker', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('first_name', models.CharField(max_length=255, verbose_name=b'Name', blank=True)), + ('last_name', models.CharField(max_length=255, verbose_name=b'Surname', blank=True)), + ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormField', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('label', models.CharField(help_text='The label of the form field', max_length=255)), + ('field_type', models.CharField(max_length=16, choices=[(b'singleline', 'Single line text'), (b'multiline', 'Multi-line text'), (b'email', 'Email'), (b'number', 'Number'), (b'url', 'URL'), (b'checkbox', 'Checkbox'), (b'checkboxes', 'Checkboxes'), (b'dropdown', 'Drop down'), (b'radio', 'Radio buttons'), (b'date', 'Date'), (b'datetime', 'Date/time')])), + ('required', models.BooleanField(default=True)), + ('choices', models.CharField(help_text='Comma seperated list of choices. Only applicable in checkboxes, radio and dropdown.', max_length=512, blank=True)), + ('default_value', models.CharField(help_text='Default value. Comma seperated values supported for checkboxes.', max_length=255, blank=True)), + ('help_text', models.CharField(max_length=255, blank=True)), + ], + options={ + 'ordering': [b'sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormPage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('to_address', models.CharField(help_text='Optional - form submissions will be emailed to this address', max_length=255, blank=True)), + ('from_address', models.CharField(max_length=255, blank=True)), + ('subject', models.CharField(max_length=255, blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.AddField( + model_name='formfield', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.FormPage'), + preserve_default=True, + ), + migrations.CreateModel( + name='PageWithOldStyleRouteMethod', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('content', models.TextField()), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='RoutablePageTest', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='SearchTest', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('title', models.CharField(max_length=255)), + ('content', models.TextField()), + ('live', models.BooleanField(default=False)), + ('published_date', models.DateField(null=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), + ), + migrations.CreateModel( + name='SearchTestChild', + fields=[ + ('searchtest_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='tests.SearchTest')), + ('subtitle', models.CharField(max_length=255, null=True, blank=True)), + ('extra_content', models.TextField()), + ], + options={ + }, + bases=('tests.searchtest',), + ), + migrations.CreateModel( + name='SearchTestOldConfig', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), + ), + migrations.CreateModel( + name='SearchTestOldConfigList', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), + ), + migrations.CreateModel( + name='SimplePage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('content', models.TextField()), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardChild', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardIndex', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='TaggedPage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='TaggedPageTag', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='taggedpage', + name='tags', + field=modelcluster.tags.ClusterTaggableManager(to=taggit.models.Tag, through=wagtail.tests.models.TaggedPageTag, blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags'), + preserve_default=True, + ), + migrations.AddField( + model_name='taggedpagetag', + name='content_object', + field=modelcluster.fields.ParentalKey(to='tests.TaggedPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='taggedpagetag', + name='tag', + field=models.ForeignKey(to='taggit.Tag'), + preserve_default=True, + ), + migrations.CreateModel( + name='ZuluSnippet', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + ] From 72ffe88d38f425474a37dab09ed89c979a4b3841 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 15:13:35 +0100 Subject: [PATCH 19/66] Deleted files that were moved in Wagtail 0.4 --- wagtail/wagtailadmin/hooks.py | 14 -------------- wagtail/wagtailcore/templatetags/pageurl.py | 11 ----------- wagtail/wagtailcore/templatetags/rich_text.py | 11 ----------- wagtail/wagtailcore/util.py | 10 ---------- .../wagtailembeds/templatetags/embed_filters.py | 11 ----------- wagtail/wagtailimages/templatetags/image_tags.py | 11 ----------- 6 files changed, 68 deletions(-) delete mode 100644 wagtail/wagtailadmin/hooks.py delete mode 100644 wagtail/wagtailcore/templatetags/pageurl.py delete mode 100644 wagtail/wagtailcore/templatetags/rich_text.py delete mode 100644 wagtail/wagtailcore/util.py delete mode 100644 wagtail/wagtailembeds/templatetags/embed_filters.py delete mode 100644 wagtail/wagtailimages/templatetags/image_tags.py diff --git a/wagtail/wagtailadmin/hooks.py b/wagtail/wagtailadmin/hooks.py deleted file mode 100644 index 8c8a2374a..000000000 --- a/wagtail/wagtailadmin/hooks.py +++ /dev/null @@ -1,14 +0,0 @@ -# The 'hooks' module is now part of wagtailcore. -# Imports are provided here for backwards compatibility - -import warnings - -from wagtail.utils.deprecation import RemovedInWagtail06Warning - - -warnings.warn( - "The wagtail.wagtailadmin.hooks module has been moved. " - "Use wagtail.wagtailcore.hooks instead.", RemovedInWagtail06Warning) - - -from wagtail.wagtailcore.hooks import register, get_hooks diff --git a/wagtail/wagtailcore/templatetags/pageurl.py b/wagtail/wagtailcore/templatetags/pageurl.py deleted file mode 100644 index 016a77759..000000000 --- a/wagtail/wagtailcore/templatetags/pageurl.py +++ /dev/null @@ -1,11 +0,0 @@ -import warnings - -from wagtail.utils.deprecation import RemovedInWagtail06Warning - - -warnings.warn( - "The pageurl tag library has been moved to wagtailcore_tags. " - "Use {% load wagtailcore_tags %} instead.", RemovedInWagtail06Warning) - - -from wagtail.wagtailcore.templatetags.wagtailcore_tags import register, pageurl diff --git a/wagtail/wagtailcore/templatetags/rich_text.py b/wagtail/wagtailcore/templatetags/rich_text.py deleted file mode 100644 index 09e93d846..000000000 --- a/wagtail/wagtailcore/templatetags/rich_text.py +++ /dev/null @@ -1,11 +0,0 @@ -import warnings - -from wagtail.utils.deprecation import RemovedInWagtail06Warning - - -warnings.warn( - "The rich_text tag library has been moved to wagtailcore_tags. " - "Use {% load wagtailcore_tags %} instead.", RemovedInWagtail06Warning) - - -from wagtail.wagtailcore.templatetags.wagtailcore_tags import register, richtext diff --git a/wagtail/wagtailcore/util.py b/wagtail/wagtailcore/util.py deleted file mode 100644 index 7bbe82f57..000000000 --- a/wagtail/wagtailcore/util.py +++ /dev/null @@ -1,10 +0,0 @@ -import warnings - -from wagtail.utils.deprecation import RemovedInWagtail06Warning - - -warnings.warn( - "The wagtail.wagtailcore.util module has been renamed. " - "Use wagtail.wagtailcore.utils instead.", RemovedInWagtail06Warning) - -from .utils import * diff --git a/wagtail/wagtailembeds/templatetags/embed_filters.py b/wagtail/wagtailembeds/templatetags/embed_filters.py deleted file mode 100644 index 1eef037e8..000000000 --- a/wagtail/wagtailembeds/templatetags/embed_filters.py +++ /dev/null @@ -1,11 +0,0 @@ -import warnings - -from wagtail.utils.deprecation import RemovedInWagtail06Warning - - -warnings.warn( - "The embed_filters tag library has been moved to wagtailembeds_tags. " - "Use {% load wagtailembeds_tags %} instead.", RemovedInWagtail06Warning) - - -from wagtail.wagtailembeds.templatetags.wagtailembeds_tags import register, embed diff --git a/wagtail/wagtailimages/templatetags/image_tags.py b/wagtail/wagtailimages/templatetags/image_tags.py deleted file mode 100644 index 00e59aca0..000000000 --- a/wagtail/wagtailimages/templatetags/image_tags.py +++ /dev/null @@ -1,11 +0,0 @@ -import warnings - -from wagtail.utils.deprecation import RemovedInWagtail06Warning - - -warnings.warn( - "The image_tags tag library has been moved to wagtailimages_tags. " - "Use {% load wagtailimages_tags %} instead.", RemovedInWagtail06Warning) - - -from wagtail.wagtailimages.templatetags.wagtailimages_tags import register, image From a05419bfd1c135db21d1c87a2e2850a52b7b9211 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 15:15:11 +0100 Subject: [PATCH 20/66] Removed css_path argument from wagtailuserbar template tag --- wagtail/wagtailadmin/templatetags/wagtailuserbar.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py index c7861185e..99449665b 100644 --- a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py +++ b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py @@ -12,13 +12,7 @@ register = template.Library() @register.simple_tag(takes_context=True) -def wagtailuserbar(context, css_path=None): - if css_path is not None: - warnings.warn( - "Passing a CSS path to the wagtailuserbar tag is no longer required; use {% wagtailuserbar %} instead", - RemovedInWagtail06Warning - ) - +def wagtailuserbar(context): # Find request object request = context['request'] From b32ba7fee9533aec1aca84f7b168332f96b54ce5 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 15:26:00 +0100 Subject: [PATCH 21/66] Use of old style routing will now raise a RuntimeError --- wagtail/wagtailcore/tests/test_page_model.py | 15 +++------------ wagtail/wagtailcore/views.py | 6 +----- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/wagtail/wagtailcore/tests/test_page_model.py b/wagtail/wagtailcore/tests/test_page_model.py index d494b2654..848691440 100644 --- a/wagtail/wagtailcore/tests/test_page_model.py +++ b/wagtail/wagtailcore/tests/test_page_model.py @@ -286,19 +286,10 @@ class TestServeView(TestCase): def test_old_style_routing(self): """ Test that route() methods that return an HttpResponse are correctly handled + + Old style routing was deprecated in Wagtail 0.4 and removed in 0.6 """ - with warnings.catch_warnings(record=True) as w: - response = self.client.get('/old-style-route/') - - # Check that a RemovedInWagtail06Warning has been triggered - self.assertEqual(len(w), 1) - self.assertTrue(issubclass(w[-1].category, RemovedInWagtail06Warning)) - self.assertTrue("Page.route should return an instance of wagtailcore.url_routing.RouteResult" in str(w[-1].message)) - - expected_page = PageWithOldStyleRouteMethod.objects.get(url_path='/home/old-style-route/') - self.assertEqual(response.status_code, 200) - self.assertEqual(response.context['self'], expected_page) - self.assertEqual(response.templates[0].name, 'tests/simple_page.html') + self.assertRaises(RuntimeError, self.client.get, '/old-style-route/') def test_before_serve_hook(self): response = self.client.get('/events/', HTTP_USER_AGENT='GoogleBot') diff --git a/wagtail/wagtailcore/views.py b/wagtail/wagtailcore/views.py index 5daa642b9..14fdba8e7 100644 --- a/wagtail/wagtailcore/views.py +++ b/wagtail/wagtailcore/views.py @@ -21,11 +21,7 @@ def serve(request, path): path_components = [component for component in path.split('/') if component] route_result = request.site.root_page.specific.route(request, path_components) if isinstance(route_result, HttpResponse): - warnings.warn( - "Page.route should return an instance of wagtailcore.url_routing.RouteResult, not an HttpResponse", - RemovedInWagtail06Warning - ) - return route_result + raise RuntimeError("Page.route should return an instance of wagtailcore.url_routing.RouteResult, not an HttpResponse") (page, args, kwargs) = route_result for fn in hooks.get_hooks('before_serve_page'): From 9cd1acd4a96753db43704dce0eac729cf8c7b92d Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 16:02:33 +0100 Subject: [PATCH 22/66] Raise error when indexed_fields setting is used --- wagtail/tests/models.py | 20 ++++- wagtail/wagtailsearch/indexed.py | 81 +++---------------- .../wagtailsearch/tests/test_indexed_class.py | 40 ++------- 3 files changed, 35 insertions(+), 106 deletions(-) diff --git a/wagtail/tests/models.py b/wagtail/tests/models.py index a38d889bd..eab72d232 100644 --- a/wagtail/tests/models.py +++ b/wagtail/tests/models.py @@ -420,6 +420,8 @@ class SearchTestOldConfig(models.Model, indexed.Indexed): """ This tests that the Indexed class can correctly handle models that use the old "indexed_fields" configuration format. + + This format was deprecated in 0.4 and removed in 0.6 """ indexed_fields = { # A search field with predictive search and boosting @@ -437,13 +439,27 @@ class SearchTestOldConfig(models.Model, indexed.Indexed): } -class SearchTestOldConfigList(models.Model, indexed.Indexed): +class SearchTestOldConfigAndNewConfig(models.Model, indexed.Indexed): """ This tests that the Indexed class can correctly handle models that - use the old "indexed_fields" configuration format using a list. + use both the old "indexed_fields" and the new "search_fields" configuration + format. + + Usually, when wagtailsearch detects that "indexed_fields" is being used, it + will raise a RuntimeError. + + This behaviour may get in the way of people developing apps that support + older versions of Wagtail. So Wagtail allows "indexed_fields" to be defined + on a classes as long as they also define "search_fields" as well. Wagtail 0.4+ + will simply ignore the "indexed_fields" attribute in this case. """ indexed_fields = ['title', 'content'] + search_fields = ( + indexed.SearchField('title'), + indexed.SearchField('content'), + ) + def routable_page_external_view(request, arg): return HttpResponse("EXTERNAL VIEW: " + arg) diff --git a/wagtail/wagtailsearch/indexed.py b/wagtail/wagtailsearch/indexed.py index e775ff5c7..eb5933751 100644 --- a/wagtail/wagtailsearch/indexed.py +++ b/wagtail/wagtailsearch/indexed.py @@ -37,80 +37,19 @@ class Indexed(object): # At toplevel, return this content type return (cls._meta.app_label + '_' + cls.__name__).lower() - @classmethod - def indexed_get_indexed_fields(cls): - # Get indexed fields for this class as dictionary - indexed_fields = cls.indexed_fields - if isinstance(indexed_fields, dict): - # Make sure we have a copy to prevent us accidentally changing the configuration - indexed_fields = indexed_fields.copy() - else: - # Convert to dict - if isinstance(indexed_fields, tuple): - indexed_fields = list(indexed_fields) - if isinstance(indexed_fields, string_types): - indexed_fields = [indexed_fields] - if isinstance(indexed_fields, list): - indexed_fields = dict((field, dict(type='string')) for field in indexed_fields) - if not isinstance(indexed_fields, dict): - raise ValueError() - - # Get indexed fields for parent class - parent = cls.indexed_get_parent(require_model=False) - if parent: - # Add parent fields into this list - parent_indexed_fields = parent.indexed_get_indexed_fields().copy() - parent_indexed_fields.update(indexed_fields) - indexed_fields = parent_indexed_fields - return indexed_fields - @classmethod def get_search_fields(cls): - search_fields = [] + # Raise an error if the 'indexed_fields' attribute is being used on a class without 'search_fields' + # Note: We still allow people to define 'indexed_fields' as long as they also define 'search_fields' + # on the same class. This allows people to still write code that is compatible with older versions + # of Wagtail and we still catch issues where code using the old 'indexed_fields' setting hasn't been + # updated. + if 'indexed_fields' in cls.__dict__ and not 'search_fields' in cls.__dict__: + raise RuntimeError("The indexed_fields attribute has been replaced with search_fields. " \ + "Please update %s.%s to use the search_fields setting." % (cls._meta.app_label, cls.__name__)) - if hasattr(cls, 'search_fields'): - search_fields.extend(cls.search_fields) - - # Backwards compatibility with old indexed_fields setting - - # Get indexed fields - indexed_fields = cls.indexed_get_indexed_fields() - - # Display deprecation warning if indexed_fields has been used - if indexed_fields: - warnings.warn("'indexed_fields' setting is now deprecated." - "Use 'search_fields' instead.", RemovedInWagtail06Warning) - - # Convert them into search fields - for field_name, _config in indexed_fields.items(): - # Copy the config to prevent is trashing anything accidentally - config = _config.copy() - - # Check if this is a filter field - if config.get('index', None) == 'not_analyzed': - config.pop('index') - search_fields.append(FilterField(field_name, es_extra=config)) - continue - - # Must be a search field, check for boosting and partial matching - boost = config.pop('boost', None) - - partial_match = False - if config.get('analyzer', None) == 'edgengram_analyzer': - partial_match = True - config.pop('analyzer') - - # Add the field - search_fields.append(SearchField(field_name, boost=boost, partial_match=partial_match, es_extra=config)) - - # Remove any duplicate entries into search fields - # We need to take into account that fields can be indexed as both a SearchField and as a FilterField - search_fields_dict = {} - for field in search_fields: - search_fields_dict[(field.field_name, type(field))] = field - search_fields = search_fields_dict.values() - - return search_fields + # Return value of 'search_fields' attribute + return getattr(cls, 'search_fields', tuple()) @classmethod def get_searchable_search_fields(cls): diff --git a/wagtail/wagtailsearch/tests/test_indexed_class.py b/wagtail/wagtailsearch/tests/test_indexed_class.py index 983d8e0ba..b89b94a03 100644 --- a/wagtail/wagtailsearch/tests/test_indexed_class.py +++ b/wagtail/wagtailsearch/tests/test_indexed_class.py @@ -17,37 +17,11 @@ class TestContentTypeNames(TestCase): self.assertEqual(name, 'tests_searchtest_tests_searchtestchild') -class TestIndexedFieldsBackwardsCompatibility(TestCase, WagtailTestUtils): - def test_indexed_fields_backwards_compatibility(self): - # Get search fields - with self.ignore_deprecation_warnings(): - search_fields = models.SearchTestOldConfig.get_search_fields() +class TestIndexedFieldsBackwardsIncompatibility(TestCase, WagtailTestUtils): + def test_use_of_indexed_fields_raises_error(self): + # SearchTestOldConfig.get_search_fields should raise a RuntimeError + self.assertRaises(RuntimeError, models.SearchTestOldConfig.get_search_fields) - search_fields_dict = dict( - ((field.field_name, type(field)), field) - for field in search_fields - ) - - # Check that the fields were found - self.assertEqual(len(search_fields_dict), 2) - self.assertIn(('title', indexed.SearchField), search_fields_dict.keys()) - self.assertIn(('live', indexed.FilterField), search_fields_dict.keys()) - - # Check that the title field has the correct settings - self.assertTrue(search_fields_dict[('title', indexed.SearchField)].partial_match) - self.assertEqual(search_fields_dict[('title', indexed.SearchField)].boost, 100) - - def test_indexed_fields_backwards_compatibility_list(self): - # Get search fields - with self.ignore_deprecation_warnings(): - search_fields = models.SearchTestOldConfigList.get_search_fields() - - search_fields_dict = dict( - ((field.field_name, type(field)), field) - for field in search_fields - ) - - # Check that the fields were found - self.assertEqual(len(search_fields_dict), 2) - self.assertIn(('title', indexed.SearchField), search_fields_dict.keys()) - self.assertIn(('content', indexed.SearchField), search_fields_dict.keys()) + def test_use_of_indexed_fields_with_search_fields_doesnt_raise_error(self): + # SearchTestOldConfigAndNewConfig.get_search_fields shouldnt raise an error + search_fields = models.SearchTestOldConfigAndNewConfig.get_search_fields() From 269d156a26ed5759e76208b8a4c0fb44990bdf9c Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 16:06:00 +0100 Subject: [PATCH 23/66] Make tests.EventPage use search_fields --- wagtail/tests/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wagtail/tests/models.py b/wagtail/tests/models.py index eab72d232..feb5b3156 100644 --- a/wagtail/tests/models.py +++ b/wagtail/tests/models.py @@ -228,8 +228,11 @@ class EventPage(Page): related_name='+' ) - indexed_fields = ('get_audience_display', 'location', 'body') - search_name = "Event" + search_fields = ( + indexed.SearchField('get_audience_display'), + indexed.SearchField('location'), + indexed.SearchField('body'), + ) password_required_template = 'tests/event_page_password_required.html' From df31e2942812151ddfe733d182a4de5b8ac08b59 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 16:20:19 +0100 Subject: [PATCH 24/66] Make sure that update_index doesn't attempt to index the SearchTestOldConfig model --- wagtail/wagtailsearch/management/commands/update_index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wagtail/wagtailsearch/management/commands/update_index.py b/wagtail/wagtailsearch/management/commands/update_index.py index c52b75639..8c587f2fd 100644 --- a/wagtail/wagtailsearch/management/commands/update_index.py +++ b/wagtail/wagtailsearch/management/commands/update_index.py @@ -12,6 +12,9 @@ class Command(BaseCommand): # Get list of indexed models indexed_models = [model for model in models.get_models() if issubclass(model, Indexed)] + # HACK: Make sure SearchTestOldConfig model is not in indexed_models to prevent test failures + indexed_models = [model for model in indexed_models if model.__name__ != 'SearchTestOldConfig'] + # Object set object_set = {} From 11c2829e7985fdb9da312b5a148bf81ca94ceb91 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 16:29:30 +0100 Subject: [PATCH 25/66] Removed features deprecated in wagtailcore models --- wagtail/wagtailcore/models.py | 45 ++++++----------------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index a237e16e6..74429e0ab 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -26,8 +26,6 @@ from django.utils.encoding import python_2_unicode_compatible from treebeard.mp_tree import MP_Node -from wagtail.utils.deprecation import RemovedInWagtail06Warning - from wagtail.wagtailcore.utils import camelcase_to_underscore from wagtail.wagtailcore.query import PageQuerySet from wagtail.wagtailcore.url_routing import RouteResult @@ -149,31 +147,6 @@ def get_page_types(): return _PAGE_CONTENT_TYPES -def get_leaf_page_content_type_ids(): - warnings.warn(""" - get_leaf_page_content_type_ids is deprecated, as it treats pages without an explicit subpage_types - setting as 'leaf' pages. Code that calls get_leaf_page_content_type_ids must be rewritten to avoid - this incorrect assumption. - """, RemovedInWagtail06Warning) - return [ - content_type.id - for content_type in get_page_types() - if not getattr(content_type.model_class(), 'subpage_types', None) - ] - -def get_navigable_page_content_type_ids(): - warnings.warn(""" - get_navigable_page_content_type_ids is deprecated, as it treats pages without an explicit subpage_types - setting as 'leaf' pages. Code that calls get_navigable_page_content_type_ids must be rewritten to avoid - this incorrect assumption. - """, RemovedInWagtail06Warning) - return [ - content_type.id - for content_type in get_page_types() - if getattr(content_type.model_class(), 'subpage_types', None) - ] - - class PageManager(models.Manager): def get_queryset(self): return PageQuerySet(self.model).order_by('path') @@ -476,14 +449,6 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index """ return (not self.is_leaf()) or self.depth == 2 - def get_other_siblings(self): - warnings.warn( - "The 'Page.get_other_siblings()' method has been replaced. " - "Use 'Page.get_siblings(inclusive=False)' instead.", RemovedInWagtail06Warning) - - # get sibling pages excluding self - return self.get_siblings().exclude(id=self.id) - @property def full_url(self): """Return the full URL (including protocol / domain) to this page, or None if it is not routable""" @@ -728,14 +693,18 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index for example, a page containing a form might have a default view of the form, and a post-submission 'thankyou' page """ - modes = self.get_page_modes() + modes = self.get_page_modes(i_know_what_im_doing=True) if modes is not Page.DEFAULT_PREVIEW_MODES: # User has overriden get_page_modes instead of using preview_modes - warnings.warn("Overriding get_page_modes is deprecated. Define a preview_modes property instead", RemovedInWagtail06Warning) + raise RuntimeError("get_page_modes has been removed. Define a preview_modes property instead.") return modes - def get_page_modes(self): + def get_page_modes(self, i_know_what_im_doing=False): + # Raise error if this was called directly + if not i_know_what_im_doing: + raise RuntimeError("get_page_modes has been removed. Use the preview_modes property instead.") + # Deprecated accessor for the preview_modes property return Page.DEFAULT_PREVIEW_MODES From ec7dfb0e84437d21fb00d82cb5d9a7c8d17a6318 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 16:34:36 +0100 Subject: [PATCH 26/66] Removed show_as_mode --- wagtail/wagtailadmin/views/pages.py | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/wagtail/wagtailadmin/views/pages.py b/wagtail/wagtailadmin/views/pages.py index 3de6f7cb5..a7212cc3e 100644 --- a/wagtail/wagtailadmin/views/pages.py +++ b/wagtail/wagtailadmin/views/pages.py @@ -12,8 +12,6 @@ from django.utils.translation import ugettext as _ from django.views.decorators.http import require_GET from django.views.decorators.vary import vary_on_headers -from wagtail.utils.deprecation import RemovedInWagtail06Warning - from wagtail.wagtailadmin.edit_handlers import TabbedInterface, ObjectList from wagtail.wagtailadmin.forms import SearchForm, CopyForm from wagtail.wagtailadmin import tasks, signals @@ -427,27 +425,6 @@ def view_draft(request, page_id): return page.serve_preview(page.dummy_request(), page.default_preview_mode) -def get_preview_response(page, preview_mode): - """ - Helper function for preview_on_edit and preview_on_create - - return a page's preview response via either serve_preview or the deprecated - show_as_mode method - """ - # Check the deprecated Page.show_as_mode method, as subclasses of Page - # might be overriding that to return a response - response = page.show_as_mode(preview_mode) - if response: - warnings.warn( - "Defining 'show_as_mode' on a page model is deprecated. Use 'serve_preview' instead", - RemovedInWagtail06Warning - ) - return response - else: - # show_as_mode did not return a response, so go ahead and use the 'proper' - # serve_preview method - return page.serve_preview(page.dummy_request(), preview_mode) - - @permission_required('wagtailadmin.access_admin') def preview_on_edit(request, page_id): # Receive the form submission that would typically be posted to the 'edit' view. If submission is valid, @@ -462,8 +439,7 @@ def preview_on_edit(request, page_id): form.save(commit=False) preview_mode = request.GET.get('mode', page.default_preview_mode) - response = get_preview_response(page, preview_mode) - + response = page.serve_preview(page.dummy_request(), preview_mode) response['X-Wagtail-Preview'] = 'ok' return response @@ -507,8 +483,7 @@ def preview_on_create(request, content_type_app_name, content_type_model_name, p page.path = Page._get_children_path_interval(parent_page.path)[1] preview_mode = request.GET.get('mode', page.default_preview_mode) - response = get_preview_response(page, preview_mode) - + response = page.serve_preview(page.dummy_request(), preview_mode) response['X-Wagtail-Preview'] = 'ok' return response From f7325ca4194d15535092767ed1de3e2bc00964e1 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 18 Aug 2014 16:40:19 +0100 Subject: [PATCH 27/66] Updated deprecation warning classes Also removed some occurances of RemovedInWagtail06Warning --- wagtail/utils/deprecation.py | 4 ++-- wagtail/wagtailadmin/templatetags/wagtailuserbar.py | 2 -- wagtail/wagtailcore/tests/test_page_model.py | 2 -- wagtail/wagtailcore/views.py | 2 -- wagtail/wagtailsearch/indexed.py | 2 -- 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/wagtail/utils/deprecation.py b/wagtail/utils/deprecation.py index 24dc4e589..dd8d89e91 100644 --- a/wagtail/utils/deprecation.py +++ b/wagtail/utils/deprecation.py @@ -1,6 +1,6 @@ -class RemovedInWagtail06Warning(DeprecationWarning): +class RemovedInWagtail07Warning(DeprecationWarning): pass -class RemovedInWagtail07Warning(PendingDeprecationWarning): +class RemovedInWagtail08Warning(PendingDeprecationWarning): pass diff --git a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py index 99449665b..2846d9506 100644 --- a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py +++ b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py @@ -3,8 +3,6 @@ import warnings from django import template from django.template.loader import render_to_string -from wagtail.utils.deprecation import RemovedInWagtail06Warning - from wagtail.wagtailcore.models import Page diff --git a/wagtail/wagtailcore/tests/test_page_model.py b/wagtail/wagtailcore/tests/test_page_model.py index 848691440..5cb21152a 100644 --- a/wagtail/wagtailcore/tests/test_page_model.py +++ b/wagtail/wagtailcore/tests/test_page_model.py @@ -4,8 +4,6 @@ from django.test import TestCase, Client from django.test.utils import override_settings from django.http import HttpRequest, Http404 -from wagtail.utils.deprecation import RemovedInWagtail06Warning - from wagtail.wagtailcore.models import Page, Site from wagtail.tests.models import EventPage, EventIndex, SimplePage, PageWithOldStyleRouteMethod diff --git a/wagtail/wagtailcore/views.py b/wagtail/wagtailcore/views.py index 14fdba8e7..e4c370ff6 100644 --- a/wagtail/wagtailcore/views.py +++ b/wagtail/wagtailcore/views.py @@ -5,8 +5,6 @@ from django.shortcuts import get_object_or_404, redirect from django.core.urlresolvers import reverse from django.conf import settings -from wagtail.utils.deprecation import RemovedInWagtail06Warning - from wagtail.wagtailcore import hooks from wagtail.wagtailcore.models import Page, PageViewRestriction from wagtail.wagtailcore.forms import PasswordPageViewRestrictionForm diff --git a/wagtail/wagtailsearch/indexed.py b/wagtail/wagtailsearch/indexed.py index eb5933751..a8e5c5e42 100644 --- a/wagtail/wagtailsearch/indexed.py +++ b/wagtail/wagtailsearch/indexed.py @@ -4,8 +4,6 @@ from six import string_types from django.db import models -from wagtail.utils.deprecation import RemovedInWagtail06Warning - class Indexed(object): @classmethod From bfd83ecefb6def80fc5df6be03b891ff4b6396cf Mon Sep 17 00:00:00 2001 From: Jose Lourenco Date: Mon, 18 Aug 2014 17:27:58 +0100 Subject: [PATCH 28/66] (re-)add pt_PT localization to wagtail 0.5.0. --- .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 17850 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 1127 +++++++++++++++++ .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 2638 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 97 ++ .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 2800 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 196 +++ .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 1158 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 57 + .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 5148 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 314 +++++ .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 2874 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 169 +++ .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 4993 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 237 ++++ .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 2708 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 153 +++ .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 0 -> 3794 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 206 +++ 18 files changed, 2556 insertions(+) create mode 100644 wagtail/wagtailadmin/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailadmin/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtailcore/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailcore/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtaildocs/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtaildocs/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtailembeds/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailembeds/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtailimages/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailimages/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtailredirects/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailredirects/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtailsearch/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailsearch/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtailsnippets/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailsnippets/locale/pt_PT/LC_MESSAGES/django.po create mode 100644 wagtail/wagtailusers/locale/pt_PT/LC_MESSAGES/django.mo create mode 100644 wagtail/wagtailusers/locale/pt_PT/LC_MESSAGES/django.po diff --git a/wagtail/wagtailadmin/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailadmin/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..6568f80a993552f7c5ef2690712aa93973ee0339 GIT binary patch literal 17850 zcmb`N3zQ{AdB+Qp6;@D?hdiYLm)+5w*;!uVukFaj1VOnSy6e3k{|@ZR~%FlpMhiI;~bCXM9I-eJmhhriJtuaRn>j_&dk0{ z`ph@~uIhSx_0{)%^;OmV(Mz6xo8fs1IvM)p0%J}%$e0yJDA$-fk22<6;BN2%u=gd# z+zkE@d@DF|v@th<&w%T|@nfh9J^;P}{5g0v_}XKQ`2=_msB&A6Gv++-{oo70uY*T| zPlE@8{{)^2{xe9|=FpcKLsRBN@MYjK@I~My;0wWPz#G9BRC_-I4*{PAUjhC*cqw@5 z@y5IwybkOI?*|#O`9An!@W&p11)fRToZ$Fc3`!*DgX(t!$dJu8k1@EE^e%82cprE; z_ydqX^9=u<4<2-)tG@tLd&m0p8KB007RaAj%fG|G*Mq7z4ju|NLGe2Ys{Afc^!QCs{67UQ0e=Fjy@e+^IUfZ|zGr|7!8Ja;1=Khipz7ZYYMi%$ zlEYU($?N-|(D%@Ep*}4b=E!|9#4*Zvr*{w}8vR_kpK?PkkU5rc2M%(4WcUM9#H(ufc%-K_;)t=94Nle4BR;SK&4;haTO?i*$Aq=DNx_v2#SxJ zLA84asPFgs^n;+je-V_Np9VGG{{Tuqe+tSk{0daPLr!!29}b>L`gl9)Ca(yueh5AY?gEbk`)F(vxE@>zz8CBVKL-wgzXUZeOM0-i zgRooh4$_YxgfD=XzS5X?fJajKX7Ga^1BAJe^xfbp@L$0QT-JvV1#bht1Rl&F67UId z4R|)4YrK=7?DIxY^12OVip)nq&C3iZ{(lH+oX`3E)v9|MmBZv>A9-vf%T-5`JF zQU0mje*tA*r=Wb8s#yxEpUt4^4}nL6b&os2V@SUn)coxRH4k3`rAJSLhl1bp_!IyA z=b-$@Z$YNc9ENeoPR{~W{z8u%K=r>BRKJ&l4BhMiC9e;I>hI&A_%+RKH&XWjEge#m|3(D!1TOZk#=!>|iCR`F<^^acl#n z_aUfxia^!79~7V8^7!|l>i@{&FMR%gftq)7zQYBe^yqL<{q%#9=Yapd3Y1*d`~1xw zF9pTN<)GSo9r$AK4WQ<4!l&O1s=Zr5$?tYh^L{TV{vHJ-kFS8T$8Uj>|Ib0q^Y1*K z@@iLZ1*mbZ2i5Nu(CQ1Q`K^PJ>wCcCz(+yN$G5@b!Jqo{?|k|gj9TS;LFx0Ap!m26 zJOTU=sCFI!HSga9HO^mxERp87p!z@Q0=FJ51*I1oL6zSIG6d5GHSSM=8t>;p&F5D^ zjpr#){QtmzKX`>JcQ`1%j|J6FpU+6#fzsD+gVMX_JRY~or3b*X$$vd~5%@lkKl3#IaINNOGEW6pfhU36!3?|sls!BP z$_~$AP_F^60yU2x1vi7A1I5>2YnANrH7_p%CC68Q8t+A*>|-m)l$)zS z$^HGH^!Of7?K}*g34Rtt#mtXE$>YSePLIw4Pb0kv#1zf7;2GdupvLtz@Nw`NQ1$Lw zhtCEd2N!|QW00D+C7{N44JbZ70UiW4pf5st^j*(R2iEU0O;&$%pC@=d^v6E^R~`jh zAkFQcL#IP;fFz^pvz^4n&?hUIlG}HnH~YM|fM4?Of9LV*;6>0MLRUanL$bpMAU%gT zurl}y|BkAdC!pofhoKuFJ;Tsfp%bA$f<~cpp?jgPKyQci91KZTdSn}4hA=nt5VQ@t z9eO9E2XW4MM+#j7ZH4rl4D~^eL+^lM=yOo< z+~r?nOM2Eq-?ne=pKMppQs^VlA3(Q3vdL4S4bW?$1<>oDUPw;@ErCWL`By!cLC4rP z_wRmS6Ep=abXnFmKI-4!2u?%tch^E|pwB}ehkBr!pfTt@&^Mt!frg;Rpf)rPErTA0 zu7V=y4rmh6^OsN)3LrhFK#QOkLAOFTLT5l9fW85}1ky7I-3@&T+6+AiJqZ=hE?!Q9 z&W3J=z5waD5;_yQMG60W7F-3r9}1yIAw7pdheCg=gnv!|uZP~})9(da(B(c|2fqfb zfYw28h4j1-T5aE)5A&}UUe5pHq216U(5E3i8=>dfH~(*8FwZkQ9%WGw=Rul8K{IUC z#^Yoxml=v{XQb1k%-)A3OOJ?JQ#^IgjzZg z!!mZ*h$o}I;EJ@}s0Y(&oAk9&&`N`e_DCbn$Ah?)tMv4${c2EL?W;w2i8IGRzRIi^ zS$Rp?iUw9J8(A4lWbtHJn+|H@VS;`I;lxB^THJ&<3tU#Co<)fp53Fm-`Iz>Z)pVL% ztAbgSM=cE`<8z)*rCB`~4>fEmM$Is8Fl@?Ef@(GE843)j+Cn_?mQ{?Dv#*mhb>5JJ%0)WRfa zC&kPZbJ~Y*roAj`rjy95$PPxcwCSd?7D#o2FmY3?W}o}z?OLaZR_(}0 zQ;LLcqKj0*=%Z%&F>#7AU!J5^l$#olYvWFx1FFQMaV>1cX~OKw1Zt6ty1Q^|dV)1} z)afAnF0P}W&eUsJ#H3Tc5rr7$cpBH}DQ!0KUUsf(X)+p*wKLlXUnZvQKU|ylgD&Y6 zH+QL0C(K&gz8^WlnUhgzXkD0(kECH%H|yZZtYa+l^t>oY@K7!9f`_K4>r zM;dBXIpx~#Rtq0FnDuf)&O5A6_R8~mg;@wLXJVLe63rkSkzKkkrBb@2W!h?65Y};( zxz~p|F40%F<u!<*YIrve;})5hl)MF6SfBs6xJI z*2q)?L%AXxYiTCJdXpjIKB8kqNHuMq-1Go^{=8# zHd#-n+}EHzVJ?ZLM3j+rZkJ`#gL3jld(6IAyX0+W%Ur@*PBD}=q+PoXI)ktGb-tkl zBsz{H80=_!_lJrZ@L|$f=hj*)m6dLl?U}81v2!{b~+o5a9txw%~T8O%H{319jH;Z;eH3fF)kY7iw z1MKRcjQ4CQ<~nj-va3+J+|25sJt37Xc=5rHWuMSzDs)by)29E@&aso~dm&t}2!jM+ zNs9u0adN>F(yZaS^3isq^T|d_W)Q#6$~3AS*<2UGNc{J-(MYGPE3nblNMw`q##{#d zQOw~mZKDM)v~!3jx9L{2GzcwQv0V35+``Ebs*c*Og0RW-R361r~v<)Tlcz zH<#J@1LXe7c3jd9v&Vw`eoi5s0+?I z!4N0x99YA%iqTmc_F8NY3&v11L69H=8)7J9SvVQCLYJ@uaXq@}Hbe24oLPYtM@JU> z?7ZD<%8w4ESvI|tHO_MBxAMV?sJZg=MN6)0N7?lDyrqS-CqI3~GO~*rbg4*`xMTik zTL%pY(sHK7MKi1e1MN1NVZuz=y;A679ZF0p;v8y)E%ao_?x$v16S;{Q_IsEB{xsk4 z)d}tQWQV_Bt-h{mKFF!`#=b<+aeY6F?W?)M)9j+C1S}S%Ca=eJ3Mt&%Q2VwzA8D5#HLc)TT{nQeSvo; zEn*G3R&*4Tnv1diLKOCB3enW#e4-Ifmwia-IvUpu>+GrJ)i5gd{tE0R zerryiTU!Ix_Bu0eU`5e=?VgMMxJ+y+YBW~4>RS0FmaxGpSf5tRrZwHl%#KHUcoqt4 zi9LC-wt7DIQi7#dM%?b8#eh=_ zyCazU%^zqKCku2oP_{rQW%uQKXk-uH@Tb=O2lfE4T64poQ_nkV%G&b=EuNeg_&ya1g$ZJ{=WmMl-G;TRQDRNiW~%!%)(n{v z7;9UKbx3Tv%P!Vm^|RPHBfIzJ#0F`WjzU%%+Lcuk?V|OVr73KsEE~3ivZeB<#|1t0 zO4QSsKFt^IgtnEK*vDe?RbU`?hh$}1c2$q-;u?oCzf-fvfyHjXo(2;0qzWl}H`RMD zN1Jg(1Es?D_nq6)1Hr<`T z=k)fU-`l@DSbpBX+2_Bqe|djD1$!?;snqoBa%Ttq%LmTwcjdHI=^f6(B1}k=uyr|)meN*|$g_}8%Yh${-!%^6Tr7fGbtnZ9sIlQlR-n3T^Vt|-v zXKNYmGfpmGix_6;(S_TFH}sz0DW~q)QunT>%Q}I^Kydy@+$wt-2qs$F2Zt99HaK}` z^lrd;=L119VUziVXI&7u*9(^!tN8);(lcP zPV^`W+D&}-%x?B%oc9qGMfpUU)KS*%Q+3taTRY9dz1o9m-=Hk8+G6K`wqRoZCO74B zZ((y}=H6xyHDY$CVK%ed@``P7f?$1kZ_!Qnx%Zw~-BY`+#d&W{2(1pNn=**q%cV(L zo^8+1>VCD+Ez7xb>~3Vcz#1yGe;;UY)$X-K12^x?_AZ z_a(JBEalwIm#fijz_Y7%P5@{SM%}}aOyfJFI_@+>B5IlR}JCJ-7^ofb{Ao7jg0{B zg%e^C)S$u%w&5BR!)>J&Ddw`|@IrM$mQ%%O4N6C1|ZZGa_ z5K5IApn@qM+iqLH*|dTH{dWh^1*>7;KCG_CHP*Z^;|9gQ74xEV4Y~+XpCUf(l(7dH z4ARCgmAW>c6^w;Htz@%lfU#n&2sP1Bkjy;bZgS@BxKg{~NI3&`f=JkpOomI*c}|Y- z??}!bGt^L{vZuaab)Lsf&PvL@>ruSZE(l^?n#C1QZW$@GOLx;8uc%>J+GJXrxsU%1 zm4$P{u$kSx4aD5`HC)oJER?AeyscJbDVdJw5@;9`tZ^6`T^|OV4~W%h2QB%<$+A)K z$F79ZsPx?O3b3t-bOxhX-fNQ8(_&F`Q>TkQq^<=y(~VR0h}reCf4%%3tyE{Ds?uB* zjbYEIhBcfl7?K*7DXY{jr3)XY;}TiB70dIv0ckuT5iFq~C&v0*(Ri~yuceqoR*g=o zneN`GEG5lM=gBLD?CWak6gyy~901shqr#TF6~M4Ubxxc5$~uH1@r0Fqq5EQ2A}Cy1 z4cA76&2bYkqY7fa+g|YxLei)qE^7FcEN!H^Y6`hpx}Gz(EH&%BLYFU<%I=%B6e{G_cr$zDl*oND#?I(+ zufFBYQ<|I0!o1c_#!;LsBLrvc>oLR@DqTHA49+m62s`)y)6Gj z(ax^1(5PP$oQC-!>0pFgc$^2}(#)On4Bl+gPY#eq=>+^$7fRsINs#Nz1FW3xx-0Sb zUHm*l3n12vO2q1eRgn8G%PRL>=r0#u{GYj_!3j?2FTHBc1ZLfQ*%NyrhLj`rIP2Vf z&D@=G`9;_E_G>5_vlm~P`(F{G?!WvvM#6X}#6 zk@}(pZfxd(RvU{S%w`_iDdoHb$6fUwL?WC65{8D{j?Mbk&O<8d7I;rqxUbLd!i@Re z%3Z2_jV{cZO5qKH32!%CmduH>d#uT$Ty|6CcK}??_=4^nI12o=S-D?x5h-iy?4mYO z)gZfDD2Cph>zDYs#aYV<5@$E!wRP?X9bn__>V5&NYW3_kTqNiVx+^fN{j@AP6S??8l^;-c3U3?E}4I3)p$Yi1%WXmS@ z>^Hl1T=+=uFi=$e(#p!iz1OANrcibgQReq}Fas5b!6nyq1ELd^Eg% zuUC7W>TaKq*!?S8hk3VaiZ!%LR}knpRw!k+ww?7jn7KC?V|9|Xp}j6ZWzoW8=-hTa z(T@TZ?fJcXuNvOEw8Jj>ffxGCl_EKSN zR&D1JnZbS3Cq$K}18fK!+aF4`BF;UAttCmJ?S9lUTWmCJXK0Bo`4WCE2Z#Q9Eo`#g z;8V)Zb1ZDlJVcb^zbTjQ*tO0HeH$QJ(4L`s);hOs zTc$jVo%?;YcAf5ykqE%uIAVHS0CJyLIQ8<@kRdq#L}rJI8mN(lNPg6#P1o zcJ3S9dSj(fk4EE!MNtLqQG403U5RDck|O@_v8EHI+pOmHILb9-FCB+;*g5l<-J9^k zf_m)i9zUlsSy$zps_j;8vIx=o;MCqWDl({CHKIjYYNa#s^_^zyLSYYqoI5DuyVK0- zdH3zeFQnlzGSz&RLE&j;s}mt$B6Fw@qYo% CZ;*Ka literal 0 HcmV?d00001 diff --git a/wagtail/wagtailadmin/locale/pt_PT/LC_MESSAGES/django.po b/wagtail/wagtailadmin/locale/pt_PT/LC_MESSAGES/django.po new file mode 100644 index 000000000..cb6f0a69e --- /dev/null +++ b/wagtail/wagtailadmin/locale/pt_PT/LC_MESSAGES/django.po @@ -0,0 +1,1127 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# Douglas Miranda , 2014 +# Gladson , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:38+0100\n" +"PO-Revision-Date: 2014-08-03 01:50+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_PT\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" + +#: edit_handlers.py:627 +msgid "Scheduled publishing" +msgstr "Publicação agendada" + +#: edit_handlers.py:641 +msgid "Common page configuration" +msgstr "Configuração comum de página" + +#: forms.py:19 +msgid "Search term" +msgstr "Procurar termo" + +#: forms.py:43 +msgid "Enter your username" +msgstr "Introduza o seu nome de utilizador" + +#: forms.py:46 +msgid "Enter password" +msgstr "Introduza a sua senha" + +#: forms.py:51 +msgid "Enter your email address to reset your password" +msgstr "Introduza o seu email para alterar a sua senha" + +#: forms.py:60 +msgid "Please fill your email address." +msgstr "Por favor, insira o seu e-mail." + +#: forms.py:73 +msgid "" +"Sorry, you cannot reset your password here as your user account is managed " +"by another server." +msgstr "" +"Desculpe, você não pode alterar a sua senha aqui porque a sua conta de " +"utilizador é gerida por outro servidor." + +#: forms.py:76 +msgid "This email address is not recognised." +msgstr "Este email não é reconhecido." + +#: forms.py:88 +msgid "New title" +msgstr "Novo título" + +#: forms.py:89 +msgid "New slug" +msgstr "Novo endereço" + +#: forms.py:95 +msgid "Copy subpages" +msgstr "Copiar sub-páginas" + +#: forms.py:97 +#, python-format +msgid "This will copy %(count)s subpage." +msgid_plural "This will copy %(count)s subpages." +msgstr[0] "Será copiada %(count)s sub-página." +msgstr[1] "Serão copiadas %(count)s sub-páginas." + +#: forms.py:106 +msgid "Publish copied page" +msgstr "Publicar página copiada" + +#: forms.py:107 +msgid "This page is live. Would you like to publish its copy as well?" +msgstr "Esta página está publicada. Gostaria de publicar também a sua cópia?" + +#: forms.py:109 +msgid "Publish copies" +msgstr "Publicar cópias" + +#: forms.py:111 +#, python-format +msgid "" +"%(count)s of the pages being copied is live. Would you like to publish its " +"copy?" +msgid_plural "" +"%(count)s of the pages being copied are live. Would you like to publish " +"their copies?" +msgstr[0] "" +"%(count)s das páginas a copiar estão publicadas. Gostaria de publicar " +"também a sua cópia?" +msgstr[1] "" +"%(count)s das páginas a copiar estão publicadas. Gostaria de publicar " +"também as suas cópias?" + +#: forms.py:124 views/pages.py:155 views/pages.py:272 +msgid "This slug is already in use" +msgstr "Esse endereço já existe" + +#: forms.py:130 templates/wagtailadmin/pages/_privacy_indicator.html:13 +#: templates/wagtailadmin/pages/_privacy_indicator.html:18 +msgid "Public" +msgstr "Público" + +#: forms.py:131 +msgid "Private, accessible with the following password" +msgstr "Privado, acessível com a seguinte senha" + +#: forms.py:139 +msgid "This field is required." +msgstr "Este campo é obrigatório." + +#: templates/wagtailadmin/base.html:7 templates/wagtailadmin/home.html:4 +msgid "Dashboard" +msgstr "Painel de controlo" + +#: templates/wagtailadmin/base.html:27 +msgid "Menu" +msgstr "Menu" + +#: templates/wagtailadmin/home.html:22 +#, python-format +msgid "Welcome to the %(site_name)s Wagtail CMS" +msgstr "Bem vindo ao %(site_name)s Wagtail CMS" + +#: templates/wagtailadmin/home.html:33 +msgid "" +"This is your dashboard on which helpful information about content you've " +"created will be displayed." +msgstr "" +"Este é o seu painel de controlo no qual serão mostradas informações úteis " +"sobre os conteúdos criados por si." + +#: templates/wagtailadmin/login.html:4 templates/wagtailadmin/login.html:59 +msgid "Sign in" +msgstr "Entrar" + +#: templates/wagtailadmin/login.html:18 +msgid "Your username and password didn't match. Please try again." +msgstr "O seu nome de utilizador ou senha não estão corretos. Tente novamente." + +#: templates/wagtailadmin/login.html:26 +msgid "Sign in to Wagtail" +msgstr "Entrar no Wagtail" + +#: templates/wagtailadmin/login.html:46 +msgid "Forgotten it?" +msgstr "Esqueceu-a?" + +#: templates/wagtailadmin/account/account.html:4 +#: templates/wagtailadmin/account/account.html:6 +msgid "Account" +msgstr "Conta" + +#: templates/wagtailadmin/account/account.html:13 +msgid "Set gravatar" +msgstr "Atribuir gravatar" + +#: templates/wagtailadmin/account/account.html:17 +msgid "" +"Your avatar image is provided by Gravatar and is connected to your email " +"address. With a Gravatar account you can set an avatar for any number of " +"other email addresses you use." +msgstr "" +"A sua imagem avatar é fornecida por Gravatar e está associada ao seu email. " +"Com uma conta do Gravatar você pode definir uma imagem avatar para qualquer " +"número de emails que você use." + +#: templates/wagtailadmin/account/account.html:25 +#: templates/wagtailadmin/account/change_password.html:4 +#: templates/wagtailadmin/account/change_password.html:6 +msgid "Change password" +msgstr "Alterar senha" + +#: templates/wagtailadmin/account/account.html:29 +msgid "Change the password you use to log in." +msgstr "Altere a senha que utiliza para entrar." + +#: templates/wagtailadmin/account/account.html:36 +msgid "Notification preferences" +msgstr "Preferências de notificação" + +#: templates/wagtailadmin/account/account.html:40 +msgid "Choose which email notifications to receive." +msgstr "Escolha quais as notificações de email a receber." + +#: templates/wagtailadmin/account/change_password.html:18 +msgid "Change Password" +msgstr "Alterar Senha" + +#: templates/wagtailadmin/account/change_password.html:21 +msgid "" +"Your password can't be changed here. Please contact a site administrator." +msgstr "A sua senha não pode ser alterada. Contacte um administrador do site." + +#: templates/wagtailadmin/account/notification_preferences.html:4 +#: templates/wagtailadmin/account/notification_preferences.html:6 +msgid "Notification Preferences" +msgstr "Preferências de notificação" + +#: templates/wagtailadmin/account/notification_preferences.html:16 +msgid "Update" +msgstr "Atualizar" + +#: templates/wagtailadmin/account/password_reset/complete.html:4 +#: templates/wagtailadmin/account/password_reset/confirm.html:42 +#: templates/wagtailadmin/account/password_reset/done.html:4 +#: templates/wagtailadmin/account/password_reset/form.html:4 +#: templates/wagtailadmin/account/password_reset/form.html:37 +msgid "Reset password" +msgstr "Alterar senha" + +#: templates/wagtailadmin/account/password_reset/complete.html:15 +msgid "Password change successful" +msgstr "Senha alterada com sucesso" + +#: templates/wagtailadmin/account/password_reset/complete.html:16 +msgid "Login" +msgstr "Login" + +#: templates/wagtailadmin/account/password_reset/confirm.html:4 +#: templates/wagtailadmin/account/password_reset/confirm.html:26 +msgid "Set your new password" +msgstr "Insira a sua nova senha" + +#: templates/wagtailadmin/account/password_reset/confirm.html:19 +msgid "The passwords do not match. Please try again." +msgstr "As senhas são diferentes. Tente novamente." + +#: templates/wagtailadmin/account/password_reset/done.html:15 +msgid "Check your email" +msgstr "Verifique o seu email" + +#: templates/wagtailadmin/account/password_reset/done.html:16 +msgid "A link to reset your password has been emailed to you." +msgstr "Um link para alterar a sua senha foi-lhe enviado para o seu email." + +#: templates/wagtailadmin/account/password_reset/email.txt:2 +msgid "Please follow the link below to reset your password" +msgstr "Por favor clique no link abaixo para alterar a sua senha" + +#: templates/wagtailadmin/account/password_reset/email_subject.txt:2 +msgid "Password reset" +msgstr "Alterar senha" + +#: templates/wagtailadmin/account/password_reset/form.html:27 +msgid "Reset your password" +msgstr "Alterar a sua senha" + +#: templates/wagtailadmin/chooser/_link_types.html:5 +#: templates/wagtailadmin/chooser/_link_types.html:7 +msgid "Internal link" +msgstr "Link interno" + +#: templates/wagtailadmin/chooser/_link_types.html:11 +#: templates/wagtailadmin/chooser/_link_types.html:13 +msgid "External link" +msgstr "Link externo" + +#: templates/wagtailadmin/chooser/_link_types.html:17 +#: templates/wagtailadmin/chooser/_link_types.html:19 +msgid "Email link" +msgstr "Link de email" + +#: templates/wagtailadmin/chooser/_search_form.html:7 +#: templates/wagtailadmin/pages/search.html:3 +#: templates/wagtailadmin/pages/search.html:16 +#: templatetags/wagtailadmin_tags.py:36 +msgid "Search" +msgstr "Procurar" + +#: templates/wagtailadmin/chooser/_search_results.html:3 +#: templatetags/wagtailadmin_tags.py:35 +msgid "Explorer" +msgstr "Explorador" + +#: templates/wagtailadmin/chooser/_search_results.html:8 +#, python-format +msgid "" +"\n" +" There is one match\n" +" " +msgid_plural "" +"\n" +" There are %(counter)s matches\n" +" " +msgstr[0] "" +"\n" +" Existe uma correspondência\n" +" " +msgstr[1] "" +"\n" +" Existem %(counter)s correspondências\n" +" " + +#: templates/wagtailadmin/chooser/browse.html:2 +#: templates/wagtailadmin/chooser/search.html:2 +#: templates/wagtailadmin/edit_handlers/page_chooser_panel.html:13 +msgid "Choose a page" +msgstr "Escolher uma página" + +#: templates/wagtailadmin/chooser/email_link.html:2 +msgid "Add an email link" +msgstr "Adicionar link de email" + +#: templates/wagtailadmin/chooser/email_link.html:14 +#: templates/wagtailadmin/chooser/external_link.html:14 +msgid "Insert link" +msgstr "Inserir link" + +#: templates/wagtailadmin/chooser/external_link.html:2 +msgid "Add an external link" +msgstr "Adicionar link externo" + +#: templates/wagtailadmin/edit_handlers/chooser_panel.html:20 +msgid "Clear choice" +msgstr "Limpar escolha" + +#: templates/wagtailadmin/edit_handlers/chooser_panel.html:22 +msgid "Choose another item" +msgstr "Escolher outro item" + +#: templates/wagtailadmin/edit_handlers/chooser_panel.html:27 +msgid "Choose an item" +msgstr "Escolher um item" + +#: templates/wagtailadmin/edit_handlers/inline_panel_child.html:5 +msgid "Move up" +msgstr "Mover para cima" + +#: templates/wagtailadmin/edit_handlers/inline_panel_child.html:6 +msgid "Move down" +msgstr "Mover para baixo" + +#: templates/wagtailadmin/edit_handlers/inline_panel_child.html:8 +#: templates/wagtailadmin/pages/confirm_delete.html:7 +#: templates/wagtailadmin/pages/edit.html:45 +#: templates/wagtailadmin/pages/list.html:84 +#: templates/wagtailadmin/pages/list.html:205 +msgid "Delete" +msgstr "Eliminar" + +#: templates/wagtailadmin/edit_handlers/page_chooser_panel.html:12 +msgid "Choose another page" +msgstr "Escolher outra página" + +#: templates/wagtailadmin/home/pages_for_moderation.html:5 +msgid "Pages awaiting moderation" +msgstr "Páginas a aguardar moderação" + +#: templates/wagtailadmin/home/pages_for_moderation.html:13 +#: templates/wagtailadmin/home/recent_edits.html:12 +#: templates/wagtailadmin/pages/list.html:121 +#: templates/wagtailadmin/pages/list.html:124 +msgid "Title" +msgstr "Título" + +#: templates/wagtailadmin/home/pages_for_moderation.html:14 +#: templates/wagtailadmin/pages/list.html:22 +msgid "Parent" +msgstr "Ascendente (pai)" + +#: templates/wagtailadmin/home/pages_for_moderation.html:15 +#: templates/wagtailadmin/pages/list.html:24 +#: templates/wagtailadmin/pages/list.html:133 +#: templates/wagtailadmin/pages/list.html:136 +msgid "Type" +msgstr "Tipo" + +#: templates/wagtailadmin/home/pages_for_moderation.html:16 +msgid "Edited" +msgstr "Editado" + +#: templates/wagtailadmin/home/pages_for_moderation.html:23 +#: templates/wagtailadmin/home/recent_edits.html:21 +#: templates/wagtailadmin/pages/list.html:176 +#: templates/wagtailadmin/pages/list.html:190 +msgid "Edit this page" +msgstr "Editar esta página" + +#: templates/wagtailadmin/home/pages_for_moderation.html:28 +#: templates/wagtailadmin/pages/_moderator_userbar.html:12 +#: templates/wagtailadmin/userbar/item_page_approve.html:8 +msgid "Approve" +msgstr "Aprovar" + +#: templates/wagtailadmin/home/pages_for_moderation.html:34 +#: templates/wagtailadmin/pages/_moderator_userbar.html:17 +#: templates/wagtailadmin/userbar/item_page_reject.html:8 +msgid "Reject" +msgstr "Rejeitar" + +#: templates/wagtailadmin/home/pages_for_moderation.html:37 +#: templates/wagtailadmin/home/recent_edits.html:23 +#: templates/wagtailadmin/pages/_moderator_userbar.html:9 +#: templates/wagtailadmin/pages/list.html:72 +#: templates/wagtailadmin/pages/list.html:190 +#: templates/wagtailadmin/userbar/item_page_edit.html:5 +msgid "Edit" +msgstr "Editar" + +#: templates/wagtailadmin/home/pages_for_moderation.html:38 +#: templates/wagtailadmin/pages/create.html:41 +#: templates/wagtailadmin/pages/edit.html:56 +#: templates/wagtailadmin/pages/preview.html:5 +msgid "Preview" +msgstr "Pre-visualizar" + +#: templates/wagtailadmin/home/recent_edits.html:5 +msgid "Your most recent edits" +msgstr "Suas últimas edições" + +#: templates/wagtailadmin/home/recent_edits.html:13 +msgid "Date" +msgstr "Data" + +#: templates/wagtailadmin/home/recent_edits.html:14 +#: templates/wagtailadmin/pages/edit.html:18 +#: templates/wagtailadmin/pages/list.html:25 +#: templates/wagtailadmin/pages/list.html:142 +#: templates/wagtailadmin/pages/list.html:145 +msgid "Status" +msgstr "Estado" + +#: templates/wagtailadmin/home/recent_edits.html:25 +#: templates/wagtailadmin/pages/list.html:75 +#: templates/wagtailadmin/pages/list.html:193 +msgid "Draft" +msgstr "Rascunho" + +#: templates/wagtailadmin/home/recent_edits.html:28 +#: templates/wagtailadmin/pages/list.html:78 +#: templates/wagtailadmin/pages/list.html:196 +msgid "Live" +msgstr "Publicado" + +#: templates/wagtailadmin/home/site_summary.html:3 +msgid "Site summary" +msgstr "Resumo do Site" + +#: templates/wagtailadmin/home/site_summary.html:7 +#, python-format +msgid "" +"\n" +" %(total_pages)s Page\n" +" " +msgid_plural "" +"\n" +" %(total_pages)s Pages\n" +" " +msgstr[0] "" +"\n" +" %(total_pages)s Página\n" +" " +msgstr[1] "" +"\n" +" %(total_pages)s Páginas\n" +" " + +#: templates/wagtailadmin/home/site_summary.html:16 +#, python-format +msgid "" +"\n" +" %(total_images)s Image\n" +" " +msgid_plural "" +"\n" +" %(total_images)s Images\n" +" " +msgstr[0] "" +"\n" +" %(total_images)s Imagem\n" +" " +msgstr[1] "" +"\n" +" %(total_images)s Imagens\n" +" " + +#: templates/wagtailadmin/home/site_summary.html:25 +#, python-format +msgid "" +"\n" +" %(total_docs)s Document\n" +" " +msgid_plural "" +"\n" +" %(total_docs)s Documents\n" +" " +msgstr[0] "" +"\n" +" %(total_docs)s Documento\n" +" " +msgstr[1] "" +"\n" +" %(total_docs)s Documentos\n" +" " + +#: templates/wagtailadmin/notifications/approved.html:1 +#, python-format +msgid "The page \"%(title)s\" has been approved" +msgstr "A página \"%(title)s\" foi aprovada" + +#: templates/wagtailadmin/notifications/approved.html:2 +#, python-format +msgid "The page \"%(title)s\" has been approved." +msgstr "A página \"%(title)s\" foi aprovada." + +#: templates/wagtailadmin/notifications/approved.html:4 +msgid "You can view the page here:" +msgstr "Pode visualizar a página aqui:" + +#: templates/wagtailadmin/notifications/base_notification.html:3 +msgid "Edit your notification preferences here:" +msgstr "Edite as suas preferências de notificação aqui:" + +#: templates/wagtailadmin/notifications/rejected.html:1 +#, python-format +msgid "The page \"%(title)s\" has been rejected" +msgstr "A página \"%(title)s\" foi rejeitada" + +#: templates/wagtailadmin/notifications/rejected.html:2 +#, python-format +msgid "The page \"%(title)s\" has been rejected." +msgstr "A página \"%(title)s\" foi rejeitada" + +#: templates/wagtailadmin/notifications/rejected.html:4 +#: templates/wagtailadmin/notifications/submitted.html:5 +msgid "You can edit the page here:" +msgstr "Você pode editar a página aqui:" + +#: templates/wagtailadmin/notifications/submitted.html:1 +#, python-format +msgid "The page \"%(page)s\" has been submitted for moderation" +msgstr "A página \"%(page)s\" foi enviada para moderação" + +#: templates/wagtailadmin/notifications/submitted.html:2 +#, python-format +msgid "The page \"%(page)s\" has been submitted for moderation." +msgstr "A página \"%(page)s\" foi enviada para moderação." + +#: templates/wagtailadmin/notifications/submitted.html:4 +msgid "You can preview the page here:" +msgstr "Pode pre-visualizar a página aqui:" + +#: templates/wagtailadmin/page_privacy/ancestor_privacy.html:2 +#: templates/wagtailadmin/page_privacy/set_privacy.html:2 +msgid "Page privacy" +msgstr "Privacidade da página" + +#: templates/wagtailadmin/page_privacy/ancestor_privacy.html:6 +msgid "This page has been made private by a parent page." +msgstr "Esta página foi classificada como privada por uma página ascendente" + +#: templates/wagtailadmin/page_privacy/ancestor_privacy.html:7 +msgid "You can edit the privacy settings on:" +msgstr "Você pode editar as configurações de privacidade em:" + +#: templates/wagtailadmin/page_privacy/set_privacy.html:6 +msgid "Note: privacy changes apply to all children of this page too." +msgstr "" +"Nota: as alterações de privacidade também serão aplicadas a todas as " +"páginas filhas desta página." + +#: templates/wagtailadmin/pages/_moderator_userbar.html:4 +#, python-format +msgid "" +"\n" +" Previewing '%(title)s', submitted by %(submitted_by)s on " +"%(submitted_on)s.\n" +" " +msgstr "" +"\n" +" Pre-visualizando '%(title)s', enviado por %(submitted_by)s em " +"%(submitted_on)s.\n" +" " + +#: templates/wagtailadmin/pages/_privacy_indicator.html:9 +msgid "Privacy" +msgstr "Privacidade" + +#: templates/wagtailadmin/pages/_privacy_indicator.html:14 +#: templates/wagtailadmin/pages/_privacy_indicator.html:20 +msgid "Private" +msgstr "Privada" + +#: templates/wagtailadmin/pages/add_subpage.html:6 +#, python-format +msgid "Create a page in %(title)s" +msgstr "Criar uma página em %(title)s" + +#: templates/wagtailadmin/pages/add_subpage.html:9 +msgid "Create a page in" +msgstr "Criar uma página em" + +#: templates/wagtailadmin/pages/add_subpage.html:13 +msgid "Choose which type of page you'd like to create." +msgstr "Escolha o tipo de página que gostaria de criar." + +#: templates/wagtailadmin/pages/add_subpage.html:26 +#, python-format +msgid "Pages using %(page_type)s" +msgstr "Páginas usando %(page_type)s" + +#: templates/wagtailadmin/pages/confirm_delete.html:3 +#, python-format +msgid "Delete %(title)s" +msgstr "Eliminar %(title)s" + +#: templates/wagtailadmin/pages/confirm_delete.html:12 +msgid "Are you sure you want to delete this page?" +msgstr "Tem certeza que deseja eliminar esta página?" + +#: templates/wagtailadmin/pages/confirm_delete.html:14 +#, python-format +msgid "" +"\n" +" This will also delete one more subpage.\n" +" " +msgid_plural "" +"\n" +" This will also delete %(descendant_count)s more " +"subpages.\n" +" " +msgstr[0] "" +"\n" +" Isto também eliminará uma ou mais sub-páginas.\n" +" " +msgstr[1] "" +"\n" +" Isto também eliminará mais %(descendant_count)s sub-" +"páginas.\n" +" " + +#: templates/wagtailadmin/pages/confirm_delete.html:22 +msgid "" +"Alternatively you can unpublish the page. This removes the page from public " +"view and you can edit or publish it again later." +msgstr "" +"Em alternativa, poderá despublicar a página. Assim, a página deixará de " +"estar visível publicamente, podendo você voltar a editá-la ou publicá-la " +"mais tarde." + +#: templates/wagtailadmin/pages/confirm_delete.html:26 +msgid "Delete it" +msgstr "Eliminá-la" + +#: templates/wagtailadmin/pages/confirm_delete.html:26 +msgid "Unpublish it" +msgstr "Despublicá-la" + +#: templates/wagtailadmin/pages/confirm_move.html:3 +#, python-format +msgid "Move %(title)s" +msgstr "Mover %(title)s" + +#: templates/wagtailadmin/pages/confirm_move.html:6 +#: templates/wagtailadmin/pages/list.html:81 +#: templates/wagtailadmin/pages/list.html:199 +msgid "Move" +msgstr "Mover" + +#: templates/wagtailadmin/pages/confirm_move.html:11 +#, python-format +msgid "Are you sure you want to move this page into '%(title)s'?" +msgstr "Tem certeza que deseja mover esta página para dentro de '%(title)s'?" + +#: templates/wagtailadmin/pages/confirm_move.html:13 +#, python-format +msgid "" +"Are you sure you want to move this page and all of its children into " +"'%(title)s'?" +msgstr "" +"Tem a certeza que deseja mover esta página e todas as suas páginas filhas " +"para dentro de '%(title)s'?" + +#: templates/wagtailadmin/pages/confirm_move.html:18 +msgid "Yes, move this page" +msgstr "Sim, mover esta página" + +#: templates/wagtailadmin/pages/confirm_unpublish.html:3 +#, python-format +msgid "Unpublish %(title)s" +msgstr "Despublicar %(title)s" + +#: templates/wagtailadmin/pages/confirm_unpublish.html:6 +#: templates/wagtailadmin/pages/edit.html:42 +#: templates/wagtailadmin/pages/list.html:87 +#: templates/wagtailadmin/pages/list.html:208 +msgid "Unpublish" +msgstr "Despublicar" + +#: templates/wagtailadmin/pages/confirm_unpublish.html:10 +msgid "Are you sure you want to unpublish this page?" +msgstr "Tem certeza que deseja despublicar esta página?" + +#: templates/wagtailadmin/pages/confirm_unpublish.html:13 +msgid "Yes, unpublish it" +msgstr "Sim, quero despublicar" + +#: templates/wagtailadmin/pages/content_type_use.html:7 +msgid "Pages using" +msgstr "Páginas usando" + +#: templates/wagtailadmin/pages/copy.html:3 +#, python-format +msgid "Copy %(title)s" +msgstr "Copiar %(title)s" + +#: templates/wagtailadmin/pages/copy.html:6 +#: templates/wagtailadmin/pages/list.html:202 +msgid "Copy" +msgstr "Copiar" + +#: templates/wagtailadmin/pages/copy.html:26 +msgid "Copy this page" +msgstr "Copiar esta página" + +#: templates/wagtailadmin/pages/create.html:5 +#, python-format +msgid "New %(page_type)s" +msgstr "Nova %(page_type)s" + +#: templates/wagtailadmin/pages/create.html:15 +msgid "New" +msgstr "Nova" + +#: templates/wagtailadmin/pages/create.html:29 +msgid "Save as draft" +msgstr "Guardar como rascunho" + +#: templates/wagtailadmin/pages/create.html:33 +#: templates/wagtailadmin/pages/edit.html:48 +msgid "Publish" +msgstr "Publicar" + +#: templates/wagtailadmin/pages/create.html:35 +#: templates/wagtailadmin/pages/edit.html:50 +msgid "Submit for moderation" +msgstr "Enviar para moderação" + +#: templates/wagtailadmin/pages/edit.html:5 +#, python-format +msgid "Editing %(title)s" +msgstr "Editando %(title)s" + +#: templates/wagtailadmin/pages/edit.html:15 +#, python-format +msgid "Editing %(title)s" +msgstr "Editando %(title)s" + +#: templates/wagtailadmin/pages/edit.html:38 +msgid "Save draft" +msgstr "Guardar rascunho" + +#: templates/wagtailadmin/pages/edit.html:77 +#, python-format +msgid "Last modified: %(last_mod)s" +msgstr "Última modificação: %(last_mod)s" + +#: templates/wagtailadmin/pages/edit.html:79 +#, python-format +msgid "by %(modified_by)s" +msgstr "por %(modified_by)s" + +#: templates/wagtailadmin/pages/index.html:3 +#, python-format +msgid "Exploring %(title)s" +msgstr "Explorando %(title)s" + +#: templates/wagtailadmin/pages/list.html:90 +#: templates/wagtailadmin/pages/list.html:211 +msgid "Add child page" +msgstr "Adicionar página filha" + +#: templates/wagtailadmin/pages/list.html:112 +msgid "Disable ordering of child pages" +msgstr "Desativar ordenação de páginas filhas" + +#: templates/wagtailadmin/pages/list.html:112 +#: templates/wagtailadmin/pages/list.html:114 +msgid "Order" +msgstr "Ordem" + +#: templates/wagtailadmin/pages/list.html:114 +msgid "Enable ordering of child pages" +msgstr "Ativar ordenação de páginas filhas" + +#: templates/wagtailadmin/pages/list.html:158 +msgid "Drag" +msgstr "Arrastar" + +#: templates/wagtailadmin/pages/list.html:237 +#: templates/wagtailadmin/pages/list.html:241 +#, python-format +msgid "Explorer subpages of '%(title)s'" +msgstr "Explorar sub-páginas de %(title)s" + +#: templates/wagtailadmin/pages/list.html:237 +#: templates/wagtailadmin/pages/list.html:241 +#: templates/wagtailadmin/pages/list.html:245 +msgid "Explore" +msgstr "Explorar" + +#: templates/wagtailadmin/pages/list.html:245 +#, python-format +msgid "Explore child pages of '%(title)s'" +msgstr "Explorar as páginas filhas de '%(title)s'" + +#: templates/wagtailadmin/pages/list.html:247 +#, python-format +msgid "Add a child page to '%(title)s'" +msgstr "Adicionar página filha a %(title)s" + +#: templates/wagtailadmin/pages/list.html:247 +msgid "Add subpage" +msgstr "Adicionar sub-página" + +#: templates/wagtailadmin/pages/list.html:256 +msgid "No pages have been created." +msgstr "Nenhuma página foi criada." + +#: templates/wagtailadmin/pages/list.html:256 +#, python-format +msgid "Why not add one?" +msgstr "Porque não adicionar uma?" + +#: templates/wagtailadmin/pages/list.html:263 +#, python-format +msgid "" +"\n" +" Page %(page_number)s of %(num_pages)s.\n" +" " +msgstr "" +"\n" +" Página %(page_number)s de %(num_pages)s.\n" +" " + +#: templates/wagtailadmin/pages/list.html:269 +#: templates/wagtailadmin/pages/search_results.html:35 +#: templates/wagtailadmin/pages/search_results.html:37 +#: templates/wagtailadmin/pages/usage_results.html:13 +#: templates/wagtailadmin/shared/pagination_nav.html:21 +#: templates/wagtailadmin/shared/pagination_nav.html:23 +#: templates/wagtailadmin/shared/pagination_nav.html:25 +msgid "Previous" +msgstr "Anterior" + +#: templates/wagtailadmin/pages/list.html:274 +#: templates/wagtailadmin/pages/search_results.html:44 +#: templates/wagtailadmin/pages/search_results.html:46 +#: templates/wagtailadmin/pages/usage_results.html:18 +#: templates/wagtailadmin/shared/pagination_nav.html:32 +#: templates/wagtailadmin/shared/pagination_nav.html:34 +#: templates/wagtailadmin/shared/pagination_nav.html:36 +msgid "Next" +msgstr "Próxima" + +#: templates/wagtailadmin/pages/move_choose_destination.html:3 +#, python-format +msgid "Select a new parent page for %(title)s" +msgstr "Selecione uma nova página ascendente para %(title)s" + +#: templates/wagtailadmin/pages/move_choose_destination.html:7 +#, python-format +msgid "Select a new parent page for %(title)s" +msgstr "Selecione uma nova página ascendente para %(title)s" + +#: templates/wagtailadmin/pages/search_results.html:6 +#, python-format +msgid "" +"\n" +" There is one matching page\n" +" " +msgid_plural "" +"\n" +" There are %(counter)s matching pages\n" +" " +msgstr[0] "" +"\n" +" Existe uma página correspondente\n" +" " +msgstr[1] "" +"\n" +" Existem %(counter)s páginas correspondentes\n" +" " + +#: templates/wagtailadmin/pages/search_results.html:16 +msgid "Other searches" +msgstr "Outras pesquisas" + +#: templates/wagtailadmin/pages/search_results.html:18 +msgid "Images" +msgstr "Imagens" + +#: templates/wagtailadmin/pages/search_results.html:19 +msgid "Documents" +msgstr "Documentos" + +#: templates/wagtailadmin/pages/search_results.html:20 +msgid "Users" +msgstr "Utilizadores" + +#: templates/wagtailadmin/pages/search_results.html:28 +#: templates/wagtailadmin/pages/usage_results.html:7 +#, python-format +msgid "" +"\n" +" Page %(page_number)s of %(num_pages)s.\n" +" " +msgstr "" +"\n" +" Página %(page_number)s de %(num_pages)s.\n" +" " + +#: templates/wagtailadmin/pages/search_results.html:54 +#, python-format +msgid "Sorry, no pages match \"%(query_string)s\"" +msgstr "Desculpe, nenhuma página satisfaz \"%(query_string)s\"" + +#: templates/wagtailadmin/pages/search_results.html:56 +msgid "Enter a search term above" +msgstr "Introduza um termo de pesquisa acima" + +#: templates/wagtailadmin/pages/usage_results.html:24 +msgid "No pages use" +msgstr "Nenhuma página usa" + +#: templates/wagtailadmin/shared/breadcrumb.html:6 +msgid "Home" +msgstr "Início" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:6 +msgid "January" +msgstr "Janeiro" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:7 +msgid "February" +msgstr "Fevereiro" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:8 +msgid "March" +msgstr "Março" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:9 +msgid "April" +msgstr "Abril" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:10 +msgid "May" +msgstr "Maio" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:11 +msgid "June" +msgstr "Junho" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:12 +msgid "July" +msgstr "Julho" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:13 +msgid "August" +msgstr "Agosto" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:14 +msgid "September" +msgstr "Setembro" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:15 +msgid "October" +msgstr "Outubro" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:16 +msgid "November" +msgstr "Novembro" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:17 +msgid "December" +msgstr "Dezembro" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:20 +msgid "Sun" +msgstr "Dom" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:21 +msgid "Mon" +msgstr "Seg" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:22 +msgid "Tue" +msgstr "Ter" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:23 +msgid "Wed" +msgstr "Qua" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:24 +msgid "Thu" +msgstr "Qui" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:25 +msgid "Fri" +msgstr "Sex" + +#: templates/wagtailadmin/shared/datetimepicker_translations.html:26 +msgid "Sat" +msgstr "Sáb" + +#: templates/wagtailadmin/shared/header.html:23 +#, python-format +msgid "Used %(useage_count)s time" +msgid_plural "Used %(useage_count)s times" +msgstr[0] "Em uso %(useage_count)s time" +msgstr[1] "Em uso %(useage_count)s times" + +#: templates/wagtailadmin/shared/main_nav.html:10 +msgid "Account settings" +msgstr "Configurações da Conta" + +#: templates/wagtailadmin/shared/main_nav.html:11 +msgid "Log out" +msgstr "Sair" + +#: templates/wagtailadmin/shared/pagination_nav.html:16 +#, python-format +msgid "Page %(page_num)s of %(total_pages)s." +msgstr "Página %(page_num)s de %(total_pages)s." + +#: templates/wagtailadmin/userbar/base.html:4 +msgid "User bar" +msgstr "Barra de utilizador" + +#: templates/wagtailadmin/userbar/base.html:14 +msgid "Go to Wagtail admin interface" +msgstr "Ir para a página admin do Wagtail" + +#: templates/wagtailadmin/userbar/item_page_add.html:5 +msgid "Add another page at this level" +msgstr "Adicionar outra página a este nível" + +#: templates/wagtailadmin/userbar/item_page_add.html:5 +msgid "Add" +msgstr "Adicionar" + +#: views/account.py:39 +msgid "Your password has been changed successfully!" +msgstr "A sua senha foi alterada com sucesso!" + +#: views/account.py:60 +msgid "Your preferences have been updated successfully!" +msgstr "As suas preferências foram atualizadas com sucesso!" + +#: views/pages.py:169 views/pages.py:286 +msgid "Go live date/time must be before expiry date/time" +msgstr "A data/hora de publicação tem de ser anterior à data/hora terminal" + +#: views/pages.py:179 views/pages.py:296 +msgid "Expiry date/time must be in the future" +msgstr "A data/hora terminal tem de ocorrer no futuro" + +#: views/pages.py:219 views/pages.py:351 views/pages.py:791 +msgid "Page '{0}' published." +msgstr "Página '{0}' publicada." + +#: views/pages.py:221 views/pages.py:353 +msgid "Page '{0}' submitted for moderation." +msgstr "Página '{0}' enviada para moderação." + +#: views/pages.py:224 +msgid "Page '{0}' created." +msgstr "Página '{0}' criada." + +#: views/pages.py:233 +msgid "The page could not be created due to validation errors" +msgstr "Esta página não pôde ser criada devido a erros na validação" + +#: views/pages.py:356 +msgid "Page '{0}' updated." +msgstr "Página '{0}' atualizada." + +#: views/pages.py:365 +msgid "The page could not be saved due to validation errors" +msgstr "A página não pôde ser guardada devido a erros na validação" + +#: views/pages.py:378 +msgid "This page is currently awaiting moderation" +msgstr "Essa página aguarda por moderação" + +#: views/pages.py:409 +msgid "Page '{0}' deleted." +msgstr "Página '{0}' eliminada." + +#: views/pages.py:575 +msgid "Page '{0}' unpublished." +msgstr "Página '{0}' despublicada." + +#: views/pages.py:627 +msgid "Page '{0}' moved." +msgstr "Página '{0}' movida." + +#: views/pages.py:709 +msgid "Page '{0}' and {1} subpages copied." +msgstr "Página '{0}' e {1} sub-páginas copiadas." + +#: views/pages.py:711 +msgid "Page '{0}' copied." +msgstr "Página '{0}' copiada." + +#: views/pages.py:785 views/pages.py:804 views/pages.py:824 +msgid "The page '{0}' is not currently awaiting moderation." +msgstr "A página '{0}' já não está aguarda moderação." + +#: views/pages.py:810 +msgid "Page '{0}' rejected for publication." +msgstr "Página '{0}' rejeitada para publicação." diff --git a/wagtail/wagtailcore/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailcore/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..51a033d0561cdeee3856abfbd526185968279272 GIT binary patch literal 2638 zcma)8J&zkj7@k1*G9W=jgM`G}pt}>d>vcZhq{d#w2-g(~Vedbv|IC1=2 zhT~j=h8vu-G#= zv3%f&y|p~j)+t_!6-&|*FO1;Xlv1sRGOvxuh+A?aL75oxx^QHr6EWS?HI=n>R4XeS z25?6MG1NxT6pvD_$nvqk10?lRe42TRm~HG=(o8AiPPCmY1-qiDkQjb+XKP5#)ME9a z3=>%tG~y~N1R3#pEv&PIB>}o14UC2s#dyd-lxb4hVGdIB28K`$D{EvQ328`A6x*$w z)QT4|Eqx@oNk_Dya;XGu8Y!^abcvjF1*-1*Y61*iRTxTG!*k+3Wcb<47AZOlFj1Y>2V$?8&o zQ4D#Vnq;A1_(*zG<+3IEj&`-F@{5|V@pC;Pewkt8~gB~xh1wWPN z16q*o5h53mfQUxURo!+w(xa%0Kmx<>Y7q6lrWHMM&PNo zER?kLMe^kmE!P&eF~imapXipGR-mnr)~)z070&|wJ7OO=bi4U zwYQT_l3-wTRg9%i{rI?3lytghPB!DVxph(BaAgbbwCU0Z8sgm6*z+pY^xhsWFBJ33 zcw*1Dwzh)VYTRR&^RdrCyWvv`!74^YLmz>yl?W#ai&r&+# z2F7vjT7NTII~wQV426j{0Kto?OKSt^o>-|@)P@()Cbo?2lB&X`J$LdfH9yZSD>_e| zm9woI(UqoizQUds8Pw4M&!<~#mmV>{z1ac5QSiO+J`VeU`mpJ|e^qAoLlpWbGYu;c zCAtdhanOaqOv{fZ&hE^<$8JOM-t@3TGH4FmnJf%NwvaL;e>5*cYk7O54F_GOl(40T zZuwk6$ULk7XP~h_(hOFnS3UfBW@%7IWpwIsnXqr62u%8=LF9C%E%{IF48oCb!d6Ln z^l03OmsFRB<^NO}so|FC+%5aFyRI%YEnO^SK0APmP{jd!M?+7|I+tpj@}-!zEVfzz z#W6&rphIB^U1=C0?QtavSR&jSPMw2y1LK%y$Mb4-06*re2d^LUv3LATdK3cif|c?p zP==h|MxkfAh~o(-z37Y_)Z7;}<^}R(5^94&{p-!!D0aYDr?VeP0i#8eK%Qp=6V&Wp zDGc!Xej2PGyvxq+!e+g(qN>>)json$Tlc-STA{|e7{likrT||vckZtr2AK?n;{-O~ zFEC0!4r}-q+)>MxIlz>w7=<^o1cAN*eR9LV28qwF*NF9C#PY!her=Y(y>a z7JaNE3+!S)?*0!K-X-@$kDA;KhdKUPa3gtOaHy>(7p4df@V-G)?|DnsUc{g`_;HXA zRD9U-#}PuR!GGb$1~S3_l|z^IY=}j%bZE_f6Dx1`J}Y>2vcfd{fLlj%VcC^N^3C=? H+~e#&PwiY_ literal 0 HcmV?d00001 diff --git a/wagtail/wagtailcore/locale/pt_PT/LC_MESSAGES/django.po b/wagtail/wagtailcore/locale/pt_PT/LC_MESSAGES/django.po new file mode 100644 index 000000000..5da56cf9a --- /dev/null +++ b/wagtail/wagtailcore/locale/pt_PT/LC_MESSAGES/django.po @@ -0,0 +1,97 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Thiago Cangussu , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:38+0100\n" +"PO-Revision-Date: 2014-08-03 01:52+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"Language: pt_PT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_PT\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" + +#: models.py:46 +msgid "" +"Set this to something other than 80 if you need a specific port number to " +"appear in URLs (e.g. development on port 8000). Does not affect request " +"handling (so port forwarding still works)." +msgstr "" +"Atribua um valor diferente de 80 se você necessitar que um número de porto " +"específico apareça nas URLs (ex. desenvolvimento no porto 8000). Não afeta o " +"tratamento de requisições (assim, o redirecionamento de portos continua a " +"funcionar)." + +#: models.py:48 +msgid "" +"If true, this site will handle requests for all other hostnames that do not " +"have a site entry of their own" +msgstr "" +"Se verdadeiro, este site irá processar requisições de todos os outros " +"hostnames que não tenham um site próprio" + +#: models.py:109 +#, python-format +msgid "" +"%(hostname)s is already configured as the default site. You must unset that " +"before you can save this site as default." +msgstr "" +"O %(hostname)s já está configurado como site pré-definido. Tem de alterar " +"essa configuração antes de poder guardar este site como pré-definido." + +#: models.py:277 +msgid "The page title as you'd like it to be seen by the public" +msgstr "O título da página como você gostaria que fosse visto pelo público" + +#: models.py:278 +msgid "" +"The name of the page as it will appear in URLs e.g http://domain.com/blog/" +"[my-slug]/" +msgstr "" +"O nome da página como ele irá aparecer nas URLs ex.: http://domain.com/blog/" +"[my-slug]/" + +#: models.py:287 +msgid "Page title" +msgstr "Título da página" + +#: models.py:287 +msgid "" +"Optional. 'Search Engine Friendly' title. This will appear at the top of the " +"browser window." +msgstr "" +"Opcional. Título 'Amigável para Motores de Busca'. Isto irá aparecer no topo " +"da janela do navegador." + +#: models.py:288 +msgid "" +"Whether a link to this page will appear in automatically generated menus" +msgstr "" +"Se um link para esta página irá aparecer nos menus gerados automaticamente" + +#: models.py:291 +msgid "Go live date/time" +msgstr "Data/hora de publicação" + +#: models.py:291 models.py:292 +msgid "Please add a date-time in the form YYYY-MM-DD hh:mm:ss." +msgstr "Por favor adicione uma data-hora no formato AAAA-MM-DD hh:mm:ss." + +#: models.py:292 +msgid "Expiry date/time" +msgstr "Data/hora terminal" + +#: models.py:564 +msgid "name '{0}' (used in subpage_types list) is not defined." +msgstr "" +"O nome '{0}' (usado na lista de tipos de sub-páginas) não está definido." diff --git a/wagtail/wagtaildocs/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtaildocs/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..2ed7e9aaff75b4f2c9bf62b9bbcdd905a1010568 GIT binary patch literal 2800 zcmb7^J8T?97{><)uj8GBXLw9ZjBW5|6m<_7`z5P2!0Ay!5iSC;4k1~;2+?V;4P5W z?cA2l?*<=1e;@cbcod{{XTT@G7`z{R52SNG0Ph7q14-_65D)tvA3E;`@E-7|eEjFU z|7$+~J4kl?m5;xCcecL{lHLbFJWS@}Z-FE)2JZvcb6y3vqyIkm0Qd=b0lW@ghOc&D zQy2YfP?qet1?~WMK!^v9fTaH_NOrfur@$*9+4&Jj^1sUY9k>hqA3<7o6MP0F=Tv}Q zAgzB1#1uP}_mAfNRglhq6QuP9BtKrs=ikleuYn5~{{ketZ-RK(pZH9Ge}lAd975ni zwjZQ*hd>%X0#ZC*1)m1bfDeHN)ZkSR?n!N=d1`Q3+DLCqvz>T{(h z-Liwt8#>`O$$!>GaOR?~g>uaH2l^+mgk8E^TZWI}xfO9yvK5%&cXAA@S<%L9jPnSt%XQB~ z!H1?~cV>9>?L?Z5HR}vc9F*w9loN$R{Ez!oOQ+k#oo?!rKj-Qj<;$Q?VK|C~< z#%N=!tVOP4t&Lc+)i~55$N|GwEv)4FeDO12;aO?N^XRg(hL$L!EdCMr$eNUu-r6*IGJ+2{+> zci!>9dtDl@WNQ>rdL~w-ekFsjz2Gr*Tj(l5~9H;&nZ_~4ih6nZ&91BZSW{gyLNitVV?a? zk4Aik*T)W5&UnXUBu!?)vX+$Kb@*|Ap>2c5Zf&_$*<3T4mz2f5PPzgqW{kA4j)LBe z$XBAQ7{wn|rEEucQ;pfWbyKxbK0<)Io^*>m(x^K9;eNJg){A1QFN6pe2wK6Q0CyA+X&s|7*89dKA(BDG5EWfi z&^QGouR29;>wQhK0@S(9{Q>8!sP1@?I&4lwfygwFkccX`)ygVg)`oH}Rr7z;Hj;;+ M!DFJWjmV1IKi#I(pa1{> literal 0 HcmV?d00001 diff --git a/wagtail/wagtaildocs/locale/pt_PT/LC_MESSAGES/django.po b/wagtail/wagtaildocs/locale/pt_PT/LC_MESSAGES/django.po new file mode 100644 index 000000000..c352afd29 --- /dev/null +++ b/wagtail/wagtaildocs/locale/pt_PT/LC_MESSAGES/django.po @@ -0,0 +1,196 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Thiago Cangussu , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:38+0100\n" +"PO-Revision-Date: 2014-08-03 01:53+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: pt_PT\n" + +#: models.py:21 templates/wagtaildocs/documents/list.html:11 +#: templates/wagtaildocs/documents/list.html:14 +#: templates/wagtaildocs/documents/usage.html:16 +msgid "Title" +msgstr "Título" + +#: models.py:22 templates/wagtaildocs/documents/list.html:17 +msgid "File" +msgstr "Ficheiro" + +#: models.py:26 +msgid "Tags" +msgstr "Etiquetas" + +#: wagtail_hooks.py:24 templates/wagtaildocs/documents/index.html:16 +msgid "Documents" +msgstr "Documentos" + +#: templates/wagtaildocs/chooser/chooser.html:2 +#: templates/wagtaildocs/edit_handlers/document_chooser_panel.html:11 +msgid "Choose a document" +msgstr "Escolher um documento" + +#: templates/wagtaildocs/chooser/chooser.html:7 +#: templates/wagtaildocs/chooser/chooser.html:19 +msgid "Search" +msgstr "Procurar" + +#: templates/wagtaildocs/chooser/chooser.html:8 +msgid "Upload" +msgstr "Enviar" + +#: templates/wagtaildocs/chooser/chooser.html:34 +#: templates/wagtaildocs/documents/add.html:25 +#: templates/wagtaildocs/documents/edit.html:29 +msgid "Save" +msgstr "Guardar" + +#: templates/wagtaildocs/chooser/results.html:5 +#: templates/wagtaildocs/documents/results.html:5 +#, python-format +msgid "" +"\n" +" There is one match\n" +" " +msgid_plural "" +"\n" +" There are %(counter)s matches\n" +" " +msgstr[0] "" +"\n" +" Existe uma correspondência\n" +" " +msgstr[1] "" +"\n" +" Existem %(counter)s correspondências\n" +" " + +#: templates/wagtaildocs/chooser/results.html:12 +msgid "Latest documents" +msgstr "Últimos documentos" + +#: templates/wagtaildocs/chooser/results.html:19 +#: templates/wagtaildocs/documents/results.html:18 +#, python-format +msgid "Sorry, no documents match \"%(query_string)s\"" +msgstr "Desculpe, nenhum documento corresponde a \"%(query_string)s\"" + +#: templates/wagtaildocs/documents/_file_field.html:5 +msgid "Change document:" +msgstr "Alterar documento" + +#: templates/wagtaildocs/documents/add.html:4 +#: templates/wagtaildocs/documents/index.html:17 +msgid "Add a document" +msgstr "Adicionar um documento" + +#: templates/wagtaildocs/documents/add.html:15 +msgid "Add document" +msgstr "Adicionar documento" + +#: templates/wagtaildocs/documents/confirm_delete.html:3 +#, python-format +msgid "Delete %(title)s" +msgstr "Eliminar %(title)s" + +#: templates/wagtaildocs/documents/confirm_delete.html:6 +#: templates/wagtaildocs/documents/edit.html:29 +msgid "Delete document" +msgstr "Eliminar documento" + +#: templates/wagtaildocs/documents/confirm_delete.html:10 +msgid "Are you sure you want to delete this document?" +msgstr "Tem certeza que quer eliminar este documento?" + +#: templates/wagtaildocs/documents/confirm_delete.html:13 +msgid "Yes, delete" +msgstr "Sim, eliminar" + +#: templates/wagtaildocs/documents/edit.html:4 +#, python-format +msgid "Editing %(title)s" +msgstr "Editando %(title)s" + +#: templates/wagtaildocs/documents/edit.html:15 +msgid "Editing" +msgstr "Editando" + +#: templates/wagtaildocs/documents/list.html:21 +#: templates/wagtaildocs/documents/list.html:24 +msgid "Uploaded" +msgstr "Enviado" + +#: templates/wagtaildocs/documents/results.html:21 +#, python-format +msgid "" +"You haven't uploaded any documents. Why not upload one now?" +msgstr "" +"Ainda não enviou nenhum documento. Porque não enviar um agora?" + +#: templates/wagtaildocs/documents/usage.html:3 +#, python-format +msgid "Usage of %(title)s" +msgstr "Utilização de %(title)s" + +#: templates/wagtaildocs/documents/usage.html:5 +msgid "Usage of" +msgstr "Utilização de" + +#: templates/wagtaildocs/documents/usage.html:17 +msgid "Parent" +msgstr "Ascendente" + +#: templates/wagtaildocs/documents/usage.html:18 +msgid "Type" +msgstr "Tipo" + +#: templates/wagtaildocs/documents/usage.html:19 +msgid "Status" +msgstr "Estado" + +#: templates/wagtaildocs/documents/usage.html:26 +msgid "Edit this page" +msgstr "Editar esta ágina" + +#: templates/wagtaildocs/edit_handlers/document_chooser_panel.html:9 +msgid "Clear choice" +msgstr "Limpar escolha" + +#: templates/wagtaildocs/edit_handlers/document_chooser_panel.html:10 +msgid "Choose another document" +msgstr "Escolher outro documento" + +#: views/documents.py:37 views/documents.py:46 +msgid "Search documents" +msgstr "Procurar documentos" + +#: views/documents.py:86 +msgid "Document '{0}' added." +msgstr "Documento '{0}' adicionado." + +#: views/documents.py:89 views/documents.py:118 +msgid "The document could not be saved due to errors." +msgstr "O documento não pôde ser guardado devido a erros." + +#: views/documents.py:115 +msgid "Document '{0}' updated" +msgstr "Documento '{0}' atualizado" + +#: views/documents.py:137 +msgid "Document '{0}' deleted." +msgstr "Documento '{0}' apagado." diff --git a/wagtail/wagtailembeds/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailembeds/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..0236ea963d4debabb4901e8eddc0dea6cebf0f36 GIT binary patch literal 1158 zcmZuv%We}f6dj;E6kx*&q%N*t140ufeV}McE1=9nR6e$KEJNaybrK00JFdw;3Dt=@ar3J z9rzBM1AYUSfIq-hAUG8SP0%&)7B~l=0sjE+13!T(&QI~@dGJ2?GWY;|1N;u0fxmzm zJUdgyAAk`$S=de%B*AIG=Q#`bo_$Y~wJMa-j=EB%BouMK%_()YA=i_ZUNkqVK|@(K zZc3#hNOBgIiIrnRf`%fOsaFTB9vddh+_&U3wHaRrMz?eB)2?(q8tKB6N%9drNE)=m zqbg1Fb$Z;{DJ7PjlPa^-|D{Bu#-Pbb#x>tFlI`|n&g9GpVZL^Gm!o?e)_{OSCZwWV zp!;gz+fIz$=8g*+Y509M+NS1KDqWrfH%Y_aI0rOn3X+VL%F=zUe=ofOiJ2I$Z6 zp1U*1F@YuO^n}5rmtVBj!}_t#m+!I(*HALWIAf}}rK==)VMHFTYty$eslnuEm*8OS|E*y0m)4**dtxE80{7F+sD=Ra+844s^^)FyqhTuMEFV>v&C17s%$X n0=ps|9eOo|9&du8{$b#rp`gQp$Co`(*UOlc9*Vx-m9G5@n>bV> literal 0 HcmV?d00001 diff --git a/wagtail/wagtailembeds/locale/pt_PT/LC_MESSAGES/django.po b/wagtail/wagtailembeds/locale/pt_PT/LC_MESSAGES/django.po new file mode 100644 index 000000000..9b6c937f6 --- /dev/null +++ b/wagtail/wagtailembeds/locale/pt_PT/LC_MESSAGES/django.po @@ -0,0 +1,57 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Thiago Cangussu , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:38+0100\n" +"PO-Revision-Date: 2014-08-03 01:53+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: pt_PT\n" + +#: forms.py:11 +msgid "Please enter a valid URL" +msgstr "Por favor introduza uma URL válida" + +#: forms.py:15 +msgid "URL" +msgstr "URL" + +#: templates/wagtailembeds/chooser/chooser.html:3 +msgid "Insert embed" +msgstr "Inserir embed" + +#: templates/wagtailembeds/chooser/chooser.html:14 +msgid "Insert" +msgstr "Inserir" + +#: views/chooser.py:33 +msgid "" +"There seems to be a problem with your embedly API key. Please check your " +"settings." +msgstr "" +"Parece existir um problema com a sua chave API de embedly. Por favor " +"verifique as suas configurações." + +#: views/chooser.py:35 +msgid "Cannot find an embed for this URL." +msgstr "Não consigo encontrar um embed para esta URL." + +#: views/chooser.py:37 +msgid "" +"There seems to be an error with Embedly while trying to embed this URL. " +"Please try again later." +msgstr "" +"Parece que houve um erro em Embedly durante a tentativa de embed esta URL. " +"Por favor tente novamente." diff --git a/wagtail/wagtailimages/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailimages/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..dfde945b64a955cd02c5e0512e281a45be5d6caa GIT binary patch literal 5148 zcmc(hTWnlM8Gt8{6fl86OAE9VhEUgb;@#M}6ldckbrUO(?=q6S4m(2A;n6lv9$C=VbI5-$jN0SO*>La0KB@1Jw_Vy8jk z0dcgm-~%U+{RDgzu9x4x1*QKh zumWF&qSw0+m8!p&-~S2ah_-MDGVivM+u=3pk3hDhUWcNWpFk4ZH~d2-mkL zHBVzm{SHEk{;CKeavg&og>@+Q(S(!m>rmwTA(ZpKQ}WkP|;C1lKziE zIpTK1Z3R zAfmHr;B+GACO)&DLRfJzM#Ehcc|_mxAcE7e*v%nn7<$;YI}g$2IOS=|rzv8~y+`yR zIv*<=X5cfFCnyIgpQTJtM4zHVIahf^uVRbxJVg<`iESOAh>gp6$Wtlc&ihH;N2NZZ zhn{-dCRY2Yjw7o>lQr7?&+pdJ(0O#c5$926lZmt#Vbj5wInUE3(tc=KR!L>kTk0Ca zJjnb`z{1jxHl|&RbDiep%c_YooyFR-fz7PW+U(HvJ*tkiP1Gt!)~LmCYPHeLIAQz! zdT$H8?@^o~X}OzYfi=DN<8B32p!|M3F)gIbNqwnfTRKj3hut;Vv|jbIHiBB+h?B%NvZB>q$!wJRaiqt0Ro%c{ z)k_^Wa#xkH6V(kXx+DFcFDLe6dJ^kap=Rspz$7hff{&4tByA+tMo1O}+H^W%BWY-Y zfIh2jK6Dbh;@ee5iqlN$RP4d7A-Np6)y4R#I+N%|VV2D#4#lu(h{H}Ur+g;yTYh8$ zo%-umEn!Phrk3JP&Te#OTB%wpmQiP|bP+>C;lWU~U0BB8duXlTC~97omHI#!93 zoO6~A#1l&pMH&s8rp-JUn3n6uDfQw=VZTO)F%gHu#?ce;VeLF~Qu|FES((KoYgPRM zu_-ib+60_=KPC-i42fmp|1wN0p;XPPNu#k$C-!pgC!(WssW@}o?7s|!g7fa6Ua;w8 zxq@QVu@&o-S4@aHOvEBCXjb+4_L}=RYjiuY&BHrK$5%}&<2;HU7l;=Z-0Our2`18= zM`&u1=kius zsmC=vvUH|iIVQ)+kjilsSJQi^ruSE-W-3$Ddit5#zJt4`rl+RpSUHQ^$kdzr?bB1! zwF3u=ev2l}D)q!fX<)KAsp;n>t}o&{HfqFr_7c@+gR)v(O^=K$k_U41S*cqSvZYfe zPt6acm}c+CV$xK^w3tgxX9TA`oxu3fA^g)Msm%_bt1nb$2K{9DrcEmIEa_qLH9d3D z&qkJlJTXCKffSS0bkuRx^zhz8x_CW29_b@`dg9Q?mnvlx7YUYP@#cQE%}J7@ zu~@36=F>(TNKVefGI__tZM}hmwm8p{e(RzicKVa4`EtenOJBky!LDR0F534-L@C}a zo9kYeT+U2J+i1m?An0;=Tx4k_nG8s}cXMmbn{Dc2ct;|0G#d`@DQ)xjJI zN5qzBg$gjFB7cYdoL(r{Gi74$eJHhfUprBjY`t#!A2F$kK zcV8Pid(Gatg2j^bSGw0p|At^mf^V7?{w4Dd45i<>e-)V2L`3rWq$Dvlo$()@v%tdYwAzCWNa$m@?GI0hYjj7FLRc;H$ixYLc zSe(h@^5&rC(uR#Z0vq?s%xCV5xto$@q|IF*2D?bO3lstr?(g=%K8dP0-{y}tFeEu= zrJIJ?Al6~`x?D6iOy}C&jbl@@aULi3ej+!CXA(&^4eEoJ!h5jacNH!f@v!fe4sM6Tr|V0g z%!;WCyE5gih0Wrw#dU>%<}+K}gcrN7g}M_XTR$F)S#eP@m@^jNi={HSr!%J!;+0r3 zsnbId+*&ej6zisYv+(cD^`YRm$c, YEAR. +# +# Translators: +# Thiago Cangussu , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:39+0100\n" +"PO-Revision-Date: 2014-08-03 01:55+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: pt_PT\n" + +#: forms.py:37 +msgid "Filter" +msgstr "Filtro" + +#: forms.py:39 +msgid "Original size" +msgstr "Dimensão original" + +#: forms.py:40 +msgid "Resize to width" +msgstr "Redimensionar pela largura" + +#: forms.py:41 +msgid "Resize to height" +msgstr "Redimensionar pela altura" + +#: forms.py:42 +msgid "Resize to min" +msgstr "Redimensionar pelo min" + +#: forms.py:43 +msgid "Resize to max" +msgstr "Redimensionar pelo máx" + +#: forms.py:44 +msgid "Resize to fill" +msgstr "Redimensionar para preencher" + +#: forms.py:47 +msgid "Width" +msgstr "Largura" + +#: forms.py:48 +msgid "Height" +msgstr "Altura" + +#: models.py:34 templates/wagtailimages/images/usage.html:16 +msgid "Title" +msgstr "Título" + +#: models.py:49 +msgid "File" +msgstr "Ficheiro" + +#: models.py:55 +msgid "Tags" +msgstr "Etiquetas" + +#: wagtail_hooks.py:64 templates/wagtailimages/images/index.html:5 +#: templates/wagtailimages/images/index.html:18 +msgid "Images" +msgstr "Imagens" + +#: templates/wagtailimages/chooser/chooser.html:3 +#: templates/wagtailimages/edit_handlers/image_chooser_panel.html:19 +msgid "Choose an image" +msgstr "Escolher uma imagem" + +#: templates/wagtailimages/chooser/chooser.html:8 +#: templates/wagtailimages/chooser/chooser.html:20 +msgid "Search" +msgstr "Procurar" + +#: templates/wagtailimages/chooser/chooser.html:9 +#: templates/wagtailimages/chooser/chooser.html:43 +msgid "Upload" +msgstr "Enviar" + +#: templates/wagtailimages/chooser/chooser.html:23 +msgid "Popular tags" +msgstr "Etiquetas frequentes" + +#: templates/wagtailimages/chooser/results.html:6 +#: templates/wagtailimages/images/results.html:6 +#, python-format +msgid "" +"\n" +" There is one match\n" +" " +msgid_plural "" +"\n" +" There are %(counter)s matches\n" +" " +msgstr[0] "" +"\n" +" Existe uma correspondência\n" +" " +msgstr[1] "" +"\n" +" Existem %(counter)s correspondências\n" +" " + +#: templates/wagtailimages/chooser/results.html:13 +#: templates/wagtailimages/images/results.html:13 +msgid "Latest images" +msgstr "Últimas imagens" + +#: templates/wagtailimages/chooser/select_format.html:3 +msgid "Choose a format" +msgstr "Escolher um formato" + +#: templates/wagtailimages/chooser/select_format.html:17 +msgid "Insert image" +msgstr "Inserir imagem" + +#: templates/wagtailimages/edit_handlers/image_chooser_panel.html:17 +msgid "Clear image" +msgstr "Limpar imagem" + +#: templates/wagtailimages/edit_handlers/image_chooser_panel.html:18 +msgid "Choose another image" +msgstr "Escolher outra imagem" + +#: templates/wagtailimages/images/_file_field.html:6 +msgid "Change image:" +msgstr "Alterar imagem:" + +#: templates/wagtailimages/images/add.html:4 +#: templates/wagtailimages/images/index.html:19 +msgid "Add an image" +msgstr "Adicionar uma imagem" + +#: templates/wagtailimages/images/add.html:15 +msgid "Add image" +msgstr "Adicionar imagem" + +#: templates/wagtailimages/images/add.html:25 +#: templates/wagtailimages/images/edit.html:33 +msgid "Save" +msgstr "Guardar" + +#: templates/wagtailimages/images/confirm_delete.html:4 +#: templates/wagtailimages/images/confirm_delete.html:8 +#: templates/wagtailimages/images/edit.html:33 +msgid "Delete image" +msgstr "Eliminar imagem" + +#: templates/wagtailimages/images/confirm_delete.html:16 +msgid "Are you sure you want to delete this image?" +msgstr "Tem a certeza que quer eliminar esta imagem?" + +#: templates/wagtailimages/images/confirm_delete.html:19 +msgid "Yes, delete" +msgstr "Sim, eliminar" + +#: templates/wagtailimages/images/edit.html:4 +#: templates/wagtailimages/images/url_generator.html:4 +#, python-format +msgid "Editing image %(title)s" +msgstr "Editando imagem %(title)s" + +#: templates/wagtailimages/images/edit.html:15 +msgid "Editing" +msgstr "Editando" + +#: templates/wagtailimages/images/results.html:31 +#, python-format +msgid "Sorry, no images match \"%(query_string)s\"" +msgstr "Desculpe, nenhuma imagem corresponde a \"%(query_string)s\"" + +#: templates/wagtailimages/images/results.html:34 +#, python-format +msgid "" +"You've not uploaded any images. Why not add one now?" +msgstr "" +"Ainda não enviou qualquer imagem. Porque não adicionar uma agora?" + +#: templates/wagtailimages/images/url_generator.html:9 +msgid "Generating URL" +msgstr "A gerar URL" + +#: templates/wagtailimages/images/url_generator.html:25 +msgid "URL" +msgstr "URL" + +#: templates/wagtailimages/images/url_generator.html:28 +msgid "Preview" +msgstr "Pre-visualizar" + +#: templates/wagtailimages/images/url_generator.html:34 +msgid "" +"Note that images generated larger than the screen will appear smaller when " +"previewed here, so they fit the screen." +msgstr "" +"Note que as imagens criadas com dimensões superiores às do ecrã serão pre-" +"visualizadas mais pequenas para caberem no ecrã." + +#: templates/wagtailimages/images/usage.html:3 +#, python-format +msgid "Usage of %(title)s" +msgstr "Utilização de %(title)s" + +#: templates/wagtailimages/images/usage.html:5 +msgid "Usage of" +msgstr "Utilização de" + +#: templates/wagtailimages/images/usage.html:17 +msgid "Parent" +msgstr "Ascendente" + +#: templates/wagtailimages/images/usage.html:18 +msgid "Type" +msgstr "Tipo" + +#: templates/wagtailimages/images/usage.html:19 +msgid "Status" +msgstr "Estado" + +#: templates/wagtailimages/images/usage.html:26 +msgid "Edit this page" +msgstr "Editar esta página" + +#: templates/wagtailimages/multiple/add.html:3 +msgid "Add multiple images" +msgstr "Adicionar múltiplas imagens" + +#: templates/wagtailimages/multiple/add.html:13 +msgid "Add images" +msgstr "Adicionar imagens" + +#: templates/wagtailimages/multiple/add.html:18 +msgid "Drag and drop images into this area to upload immediately." +msgstr "Arrastar e largar imagens nesta área para envio imediato." + +#: templates/wagtailimages/multiple/add.html:22 +msgid "Or choose from your computer" +msgstr "Ou escolha no seu computador" + +#: templates/wagtailimages/multiple/add.html:47 +msgid "" +"Upload successful. Please update this image with a more appropriate title, " +"if necessary. You may also delete the image completely if the upload wasn't " +"required." +msgstr "" +"Envio com sucesso. Por favor atualize esta imagem com um título mais " +"apropriado se necessário. Também pode eliminar completamente a imagem se o " +"envio não era pretendido." + +#: templates/wagtailimages/multiple/add.html:48 +msgid "Sorry, upload failed." +msgstr "Desculpe, o envio falhou." + +#: templates/wagtailimages/multiple/edit_form.html:10 +msgid "Update" +msgstr "Atualizar" + +#: templates/wagtailimages/multiple/edit_form.html:11 +msgid "Delete" +msgstr "Eliminar" + +#: utils/validators.py:17 utils/validators.py:28 +msgid "" +"Not a valid image. Please use a gif, jpeg or png file with the correct file " +"extension (*.gif, *.jpg or *.png)." +msgstr "" +"Não é uma imagem válida. Por favor use uma imagem do tipo gif, jpeg, ou " +"png, com a extensão de nome correta (*.gif, *.jpg or *.png)." + +#: utils/validators.py:35 +#, python-format +msgid "" +"Not a valid %s image. Please use a gif, jpeg or png file with the correct " +"file extension (*.gif, *.jpg or *.png)." +msgstr "" +"Não é uma imagem do tipo %s válida. Por favor use uma imagem do tipo gif, " +"jpeg, ou png, com a extensão de nome correta (*.gif, *.jpg or *.png)." + +#: views/images.py:37 views/images.py:47 +msgid "Search images" +msgstr "Procurar imagens" + +#: views/images.py:99 +msgid "Image '{0}' updated." +msgstr "Imagem '{0}' atualizada." + +#: views/images.py:102 +msgid "The image could not be saved due to errors." +msgstr "A imagem não pôde ser guardada devido a erros." + +#: views/images.py:188 +msgid "Image '{0}' deleted." +msgstr "Imagem '{0}' eliminada." + +#: views/images.py:206 +msgid "Image '{0}' added." +msgstr "Imagem '{0}' adicionada." + +#: views/images.py:209 +msgid "The image could not be created due to errors." +msgstr "A imagem não pôde ser criada devido a erros." diff --git a/wagtail/wagtailredirects/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailredirects/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..e6fb7e2b6559538f746b3ec181e4ca50d4600eb5 GIT binary patch literal 2874 zcmbW2&x;&I6vxXLHBO?@_#^R0q*w?$i|NTsei3JX#5KE#kxd*o6Qdw5wbO5BI!;%0 zs;YN05hWma6HgH@f*}XNgBSHA2r}SV^rQzt{{Sy~l;HPu&-Bi2mK-d$=hIdFs_NBy zufF^Hp6xdT+H-iG#k1=kAtu0oL2jRK6XGrKCb$c{4OYON_X=@8SO<55v*1(UYv3O6 z9qyzU?1W8gm^&);!h zzV06I5%l+h$G|dJ1>XkQ-;Y7KF1`mbRr~<%1b+nC&!53-IP-5{jQ&LovOj&0*ZURR z0q(}nu<5JFxw z&LR5=_wrVfBdysXOEPlOXp*t=txoY-6mM*w8!8wdD7Q?iJ=qDD&mdP=irFxfmcqzV z%Zpi9_e?5XI(S)A+DmU_NL}(IeFqy4txt-%Y;=HPd~+ZB`^a}`!io7X!g8aFWJ8f| z4>@9d+L~CLH^sV6cGN1#Wg;zGmXxQkA}@7%QX4O)lw zY1mszZFjbRvC^cySfrMTW6~k7T?~)7Kst+!BV}71NxB_ra&pDk zHu1?wnrSUQ z;mPLFJR5h8r%9MaW!;{4UGE{0D%)@4knYKgiwnh=6BiI?aUnnAFmM<(*7gn}+9Tn} z3Q&$sQ9N^?d?h8@TXNnapA&BC5C+Et%CNAPs6&K@^R-OF9Lg|7VHru*8tW=|nc(17 zc!#+W&0a#{O>zeZWhxRI#me?X!)>n{yiV3dM%U$~ygFpHa;#D;VYOPv@VX#Q65ih;j z?ue|`>c@`fb_>e+plOwMUFD6f%U6sexnOY5bj!%8%jmw?9ds*eZl<)LbUQ^I1x->h zTsn95-2D0}YViG(!JXDv7RRqkPgnh+q^lx5DO(+79r@{t&C|h&bvxdEg={d7Ekop} zE>A2+zSQWZR&|5Z#>TELb&_@6^x;XFzfPC6oRPJO$r=BXP*ENUSI$_`4c z|3&{6>Vjg_dyA~6Yf7RzWn!UXxP6kkQ5>;7Ij=@1ofPwfPsPjV=Pd_EG>Zjpi&Zmq z!__y%%gCHL66Z;GI6C=d%e;rCM7Sc63ROkQhOz9w#LI}sz$#K61w$Az!NP&Y-dA%SZt5L{W&zcHJz3UvP4BQUY9kUt;hG<5K5f`HPU~y$w LU2$_0)fN8%cfTv& literal 0 HcmV?d00001 diff --git a/wagtail/wagtailredirects/locale/pt_PT/LC_MESSAGES/django.po b/wagtail/wagtailredirects/locale/pt_PT/LC_MESSAGES/django.po new file mode 100644 index 000000000..759a4906a --- /dev/null +++ b/wagtail/wagtailredirects/locale/pt_PT/LC_MESSAGES/django.po @@ -0,0 +1,169 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Thiago Cangussu , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:39+0100\n" +"PO-Revision-Date: 2014-08-03 01:56+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: pt_PT\n" + +#: models.py:10 +msgid "Redirect from" +msgstr "Redirecionar de" + +#: models.py:12 +msgid "Permanent" +msgstr "Permanente" + +#: models.py:12 +msgid "" +"Recommended. Permanent redirects ensure search engines forget the old page " +"(the 'Redirect from') and index the new page instead." +msgstr "" +"Recomendado. Redirecionamentos permanentes garantem que os motores de busca " +"esqueçam a página antiga (o 'Redirecionar de') e indexem a nova página." + +#: models.py:13 +msgid "Redirect to a page" +msgstr "Redirecionar para uma página" + +#: models.py:14 +msgid "Redirect to any URL" +msgstr "Redirecionar para qualquer URL" + +#: views.py:58 +msgid "Search redirects" +msgstr "Procurar redireções" + +#: views.py:71 +msgid "Redirect '{0}' updated." +msgstr "Redireção '{0}' atualizada." + +#: views.py:74 +msgid "The redirect could not be saved due to errors." +msgstr "A redireção não pôde ser guardada devido a erros." + +#: views.py:92 +msgid "Redirect '{0}' deleted." +msgstr "Redireção '{0}' eliminada." + +#: views.py:112 +msgid "Redirect '{0}' added." +msgstr "Redireção '{0}' adicionada." + +#: views.py:115 +msgid "The redirect could not be created due to errors." +msgstr "A redireção não pôde ser criada devido a erros." + +#: wagtail_hooks.py:22 templates/wagtailredirects/index.html:3 +#: templates/wagtailredirects/index.html:17 +msgid "Redirects" +msgstr "Redireções" + +#: templates/wagtailredirects/add.html:3 templates/wagtailredirects/add.html:6 +#: templates/wagtailredirects/index.html:18 +msgid "Add redirect" +msgstr "Adicionar redireção" + +#: templates/wagtailredirects/add.html:14 +#: templates/wagtailredirects/edit.html:14 +msgid "Save" +msgstr "Guardar" + +#: templates/wagtailredirects/confirm_delete.html:4 +#, python-format +msgid "Delete redirect %(title)s" +msgstr "Eliminar redireção %(title)s" + +#: templates/wagtailredirects/confirm_delete.html:6 +msgid "Delete" +msgstr "Eliminar" + +#: templates/wagtailredirects/confirm_delete.html:10 +msgid "Are you sure you want to delete this redirect?" +msgstr "Tem a certeza que pretende eliminar esta redireção?" + +#: templates/wagtailredirects/confirm_delete.html:13 +msgid "Yes, delete" +msgstr "Sim, eliminar" + +#: templates/wagtailredirects/edit.html:4 +#, python-format +msgid "Editing %(title)s" +msgstr "Editando %(title)s" + +#: templates/wagtailredirects/edit.html:6 +msgid "Editing" +msgstr "Editando" + +#: templates/wagtailredirects/edit.html:15 +msgid "Delete redirect" +msgstr "Eliminar redireção" + +#: templates/wagtailredirects/list.html:11 +#: templates/wagtailredirects/list.html:14 +msgid "From" +msgstr "De" + +#: templates/wagtailredirects/list.html:17 +msgid "To" +msgstr "Para" + +#: templates/wagtailredirects/list.html:18 +msgid "Type" +msgstr "Tipo" + +#: templates/wagtailredirects/list.html:25 +msgid "Edit this redirect" +msgstr "Editar esta redireção" + +#: templates/wagtailredirects/list.html:34 +msgid "primary" +msgstr "principal" + +#: templates/wagtailredirects/results.html:5 +#, python-format +msgid "" +"\n" +" There is one match\n" +" " +msgid_plural "" +"\n" +" There are %(counter)s matches\n" +" " +msgstr[0] "" +"\n" +" Existe uma correspondência\n" +" " +msgstr[1] "" +"\n" +" Existem %(counter)s correspondências\n" +" " + +#: templates/wagtailredirects/results.html:18 +#, python-format +msgid "Sorry, no redirects match \"%(query_string)s\"" +msgstr "" +"Desculpe, nenhuma redireção corresponde a \"%(query_string)s\"" + +#: templates/wagtailredirects/results.html:21 +#, python-format +msgid "" +"No redirects have been created. Why not add one?" +msgstr "" +"Nenhuma redireção foi criada. Porque não adicionar uma?" diff --git a/wagtail/wagtailsearch/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailsearch/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..1b03459c4fd57bdaa1f4683609b7085a8297a5d5 GIT binary patch literal 4993 zcmbW4O^h5z6~_x40$Dvi?`#N5S8MkAr_|@GVgGeT>QX zgD1fEf#<*0@4(aFK;bK5Fa}>{(}?%~!H7q} zud=BI$Kd1OkHN2jZ-A(#9(})34}yom4}qTpW&HVOybnIc^8oxb_#N;G@Ry+M{|8X? z`WGns+zToH03Qa0pZj>pEA@?N;teC3k;n{W)e3t#Oe zI)8-kQN9wt&=>shF;Fhi@l)YWsToi>!!_YTq#~>Xf1;Q2g9phq-x# z?*dZoW!O z-_>i~!S1cct}1k1BqLLdb?h=zCN2wdbm>s2^0sJp5lyy|a>!_Ey%$*{=9ab?=`^`z z_3Vlrtqzh+Cax@UJKJ4Z%vblBuJ(;UMt{iqtF^YW1gPjN1?)vS~bLy#$Q9TX|cgV zuFI>`pr3FlI|hdbNBE?)`$^kP7)%i=35znTN2ZL16Fv``C~-Q8^@RvvWh)u3T1Y!u2#dn`OQ%&|Sz0UhC>}nVz_zj^6M>d|TKTtE7Ns zQ8o<{=cyUnc!8)&S7iR0^4kY5Bt(}?X!u+=r`pup*>^(L8iM3Yxn+Ts~jHbzOQ z4Efg>rsK+rGeSDQ-5O8!#(P#=WlUWSC9475mway@YFgTmY)2*DDQv)>?b*)vk>}!eL@_H^861S|qHLt#G{X&xuYQ1nbZB%xii#yk- zJCyom{X*?a-Rqw0_GYfw+!bZ#q8}u2=kwLTclvHw&#YhWcb=AvVM*s1(qdU3>n)w= z^iFkpOM2HqbM!0i?Q)T< zNV3zEW>a`up7~<`+0LoyJQ2TPi_RJ%rRp#1Q#X=wW<9M6lXjkUICEKNd3f|^j-A%^ z?U}huuj-}w(=%V{oVS@RY75q#cw8^RBa)iXTNX$rQ+dp-(f^SNX!1*0BC9F04+K5-O zne)l^&t$GiOCuw7E}GZ{;kotH8*jRLoqA($cNcbwHk5bMDj>~57A3h!MeDj_*kqR= zQ#5J!iluqrV0NKHUJ|^E5ObUc z({{Nh_#O?1c-|*43&G;S4LL4YWTBWtmkicZd4v=*z2%VJ*In!;dF^)MSze8db`gbW z`xiLcOpd67CXaUY7CTn$YA})znGjRQdoVF{9JCtkyUcCkl)Fq2wVEWD24`%jdm|i7 zpqKWJsk5VXqfL_$IYX2!4cOuq2Y)Z#T`9M6yJhOr503e!E*~JDf3<-yT0I zArf6&K`ap~88%HIywN0KS8uE**E#BNMngLcHFq z_Jx!D1Yy!5QNkoaLm}BY5b-BTT_XD=5*tFN?9tUEG?n6`P({Ut zP@VsewyDht1U1c5kUA|#R0t_;*z8)3=!6Q2%BIxs=KrFoz+V^o%}{wo?MW4@PlJOZ zzjj17^b>U%Yy3=I34dIyuNy2WhK*-}p)_bXrKUjG=dYIhgACQMd$%PV>jiZcXYXBf zKD;R=aXh)veX09?`Yb2o0YN@VfDmcYckLUgPY(Wi_^3*AOY`+VT`Zh$zc#ARt-G{g hD0VF&dL<7VhUT_kPfG%b&>fk~(ElZ)g*N*O^, YEAR. +# +# Translators: +# Gladson , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:39+0100\n" +"PO-Revision-Date: 2014-08-03 01:58+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: pt_PT\n" + +#: forms.py:9 +msgid "Search term(s)/phrase" +msgstr "Procurar termo(s)/frase" + +#: forms.py:10 +msgid "" +"Enter the full search string to match. An \n" +" exact match is required for your Editors Picks to be \n" +" displayed, wildcards are NOT allowed." +msgstr "" +"introduza a frase completa a procurar. É \n" +" necessária uma coincidência exacta com os termos de procura para que " +"as suas Seleções de Editor sejam \n" +" mostradas, caracteres de substituição (wildcards) NÃO são permitidos." + +#: forms.py:36 +msgid "Please specify at least one recommendation for this search term." +msgstr "" +"Por favor especifique pelo menos uma recomendação para este termo de procura." + +#: wagtail_hooks.py:23 templates/wagtailsearch/editorspicks/list.html:9 +msgid "Editors picks" +msgstr "Escolhas do editor" + +#: templates/wagtailsearch/editorspicks/add.html:3 +#: templates/wagtailsearch/editorspicks/add.html:5 +msgid "Add editor's pick" +msgstr "Adicionar escolha de editor" + +#: templates/wagtailsearch/editorspicks/add.html:10 +msgid "" +"\n" +"

    Editors picks are a means of recommending specific pages " +"that might not organically come high up in search results. E.g recommending " +"your primary donation page to a user searching with a less common term like " +"\"giving\".

    \n" +" " +msgstr "" +"\n" +"

    Escolhas de Editores servem para recomendar páginas que " +"poderiam não ser selecionadas para aparecer em posição alta em resultados de " +"pesquisa. Por ex., recomendar a sua página principal de donativos para ser " +"pesquisada usando termos menos comuns como \"dar\".

    \n" +" " + +#: templates/wagtailsearch/editorspicks/add.html:13 +msgid "" +"\n" +"

    The \"Search term(s)/phrase\" field below must contain " +"the full and exact search for which you wish to provide recommended results, " +"including any misspellings/user error. To help, you can choose from " +"search terms that have been popular with users of your site.

    \n" +" " +msgstr "" +"\n" +"

    O campo \"Procurar termo(s)/frase\" abaixo tem de conter " +"a pesquisa completa e exata para a qual pretende indicar resultados " +"recomendados, incluindo quaisquer erros de ortografia/utilizador. " +"Para facilitar, pode escolher de entre termos de pesquisa que tenham sido " +"usados frequentemente por utilizadores do seu site.

    \n" +" " + +#: templates/wagtailsearch/editorspicks/add.html:27 +#: templates/wagtailsearch/editorspicks/edit.html:19 +msgid "Save" +msgstr "Guardar" + +#: templates/wagtailsearch/editorspicks/confirm_delete.html:3 +#, python-format +msgid "Delete %(query)s" +msgstr "Eliminar %(query)s" + +#: templates/wagtailsearch/editorspicks/confirm_delete.html:5 +#: templates/wagtailsearch/editorspicks/edit.html:20 +#: templates/wagtailsearch/editorspicks/includes/editorspicks_form.html:6 +msgid "Delete" +msgstr "Eliminar" + +#: templates/wagtailsearch/editorspicks/confirm_delete.html:9 +msgid "Are you sure you want to delete all editors picks for this search term?" +msgstr "" +"Tem a certeza que pretende eliminar todas as escolhas de editores para este " +"termo de pesquisa?" + +#: templates/wagtailsearch/editorspicks/confirm_delete.html:12 +msgid "Yes, delete" +msgstr "Sim, eliminar" + +#: templates/wagtailsearch/editorspicks/edit.html:3 +#, python-format +msgid "Editing %(query)s" +msgstr "Editando %(query)s" + +#: templates/wagtailsearch/editorspicks/edit.html:5 +msgid "Editing" +msgstr "Editando" + +#: templates/wagtailsearch/editorspicks/index.html:3 +msgid "Search Terms" +msgstr "Procurar Termos" + +#: templates/wagtailsearch/editorspicks/index.html:17 +msgid "Editor's search picks" +msgstr "Procurar escolhas de editor" + +#: templates/wagtailsearch/editorspicks/index.html:18 +msgid "Add new editor's pick" +msgstr "Adicionar nova escolha de editor" + +#: templates/wagtailsearch/editorspicks/list.html:8 +msgid "Search term(s)" +msgstr "Procurar termo(s)" + +#: templates/wagtailsearch/editorspicks/list.html:10 +#: templates/wagtailsearch/queries/chooser/results.html:8 +msgid "Views (past week)" +msgstr "Visualizações (última semana)" + +#: templates/wagtailsearch/editorspicks/list.html:17 +msgid "Edit this pick" +msgstr "Editar esta escolha" + +#: templates/wagtailsearch/editorspicks/list.html:23 +msgid "None" +msgstr "Nenhuma" + +#: templates/wagtailsearch/editorspicks/results.html:5 +#, python-format +msgid "" +"\n" +" There is one match\n" +" " +msgid_plural "" +"\n" +" There are %(counter)s matches\n" +" " +msgstr[0] "" +"\n" +" Existe uma ocorrência\n" +" " +msgstr[1] "" +"\n" +" Existem %(counter)s ocorrências\n" +" " + +#: templates/wagtailsearch/editorspicks/results.html:18 +#, python-format +msgid "Sorry, no editor's picks match \"%(query_string)s\"" +msgstr "" +"Desculpe, nenhuma escolha de editor contém \"%(query_string)s\"" + +#: templates/wagtailsearch/editorspicks/results.html:21 +#, python-format +msgid "" +"No editor's picks have been created. Why not add one?" +msgstr "" +"Nenhuma escolha de editor foi criada. Porque não adicionar uma?" + +#: templates/wagtailsearch/editorspicks/includes/editorspicks_form.html:4 +msgid "Move up" +msgstr "Mover para cima" + +#: templates/wagtailsearch/editorspicks/includes/editorspicks_form.html:5 +msgid "Move down" +msgstr "Mover para baixo" + +#: templates/wagtailsearch/editorspicks/includes/editorspicks_form.html:10 +msgid "Editors pick" +msgstr "Escolha de editor" + +#: templates/wagtailsearch/editorspicks/includes/editorspicks_formset.html:14 +msgid "Add recommended page" +msgstr "Adicionar uma página recomendada" + +#: templates/wagtailsearch/queries/chooser/chooser.html:2 +msgid "Popular search terms" +msgstr "Termos de procura populares" + +#: templates/wagtailsearch/queries/chooser/chooser.html:11 +msgid "Search" +msgstr "Procurar" + +#: templates/wagtailsearch/queries/chooser/results.html:7 +msgid "Terms" +msgstr "Termos" + +#: templates/wagtailsearch/queries/chooser/results.html:22 +msgid "No results found" +msgstr "Nenhum resultado encontrado" + +#: views/editorspicks.py:47 +msgid "Search editor's picks" +msgstr "Procurar nas escolhas de editor" + +#: views/editorspicks.py:83 +msgid "Editor's picks for '{0}' created." +msgstr "Escolhas de editor para '{0}' criadas." + +#: views/editorspicks.py:89 +msgid "Recommendations have not been created due to errors" +msgstr "Recomendações não foram criadas devido a erros." + +#: views/editorspicks.py:117 +msgid "Editor's picks for '{0}' updated." +msgstr "Escolhas de editor para '{0}' atualizadas." + +#: views/editorspicks.py:123 +msgid "Recommendations have not been saved due to errors" +msgstr "Recomendações não foram guardadas devido a erros." + +#: views/editorspicks.py:142 +msgid "Editor's picks deleted." +msgstr "Escolhas de editor eliminadas." diff --git a/wagtail/wagtailsnippets/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailsnippets/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..eeab056130f7fc84e4da93cc2c99bc009355e43c GIT binary patch literal 2708 zcma)-&u<$=6vqc>`C(cL1zKn+jH-qtO4hN{6oT`sA$6moB()lcfP`dCyc2t?^~^Fe z>yT8vlp9xsxNx9Cf)h6?4(%=f1LA~w;ef;yAt8kLKJVIT%f@8n+0V@Gn>X*xd-MFu z@k3uQwAayJLqGBuW5eLzAhoX_XY5t*HaG>|1)l`}1WEoM@EmyhiRAr7a0K&3@HxQ!oeq1!5^X{7ka$C^&%m36T7q2FYIylD}=R z2!0FFx}QPPe;+&s{t8mO{s51H$FRvDcm{kEET{7jOhb&fj3JEd1@sd%K_g$N!94a7 zI-MQGi(+>K9qQT3=;RaGcLx0xbZRHj>8!eq@&wy;?4oziqf<;MKgi~e{~-B6Hb2zn zeV-2uSrtT)bTzjf$(j-^Ic(Xyk$hXn+{Wo(ODM;k=DrN2liW1}o4s_7Ei|>ZGDWsf z_oGnSHKo}{=u&4dmLOY(dw3rx>x8P4-DN+3nPglf8nQDDRHMs-=~$6l44r37vlX57 zp%#U)5#g}qP0^NoLrTT#MhYkWJYR2ab9l<91#cR;IdgVkXiGGl2*UL2Z7q?l#Re+Q z&I$xZD>*$TX6IN%7^xgvgn`^#IH?f*wQaG_*XBph3_2o%?wy#YLO^cm6oP}hoWj8%-jF6+*_;(PB)V*{;9d_9R7FXS)e z3%P4D(#Cnqwh{Q=yK%#MRbAq_%GIj3K!L{+?-G=i_;{f>;T0ymLXj8WDxH64q);pr zAn09_?SNE2DtDe2ilqyaiQJN~&Z`=sY$%*ICH@|67hlr2nX0b&^mR-xhUqlFWoL6s zLN#KXs#lew1(TMqESLAZD8lvytsHX7qX?9^lb^V;C=`L3;`OF5R=SzB>Sb?oPmZ?V zl*TJ#OCL9?#3wfbm#cJ=-n*<#%a*uG?tq;cpW?}IW=Qc_UL2mvec&xhB~9W%MN7J; zMV#YA&)O1?T&+^gv3WnJ<50wYWuYotT=2RyPVNZ)G4c@Ia2W=zfL2M10+o^K!*-69 zZC!_`IK4r(;NE8)JCk|gso11D_6FI?vT9Ufrr^=;?FNkQ6eyv5-5VTC)rxLw6r{G^ zw^&Klj9XdCdKaH>>Hs$=5WddyiZ*nhYWEvt*1@Y)H(+rqDOvNjE|rfAlWZ{-#uuhn zih6^-M(s%*ymFQCFMt!g+N)a~FQVNae3UXINa7>vNjva0GKfkSD%Za9xI?fUqK~eq z?tbs$P_t?fX}0EqFxU~h-_eozsAmt);bpg)tp=^pUY7PPRj9y%lp-R1<{f+, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:39+0100\n" +"PO-Revision-Date: 2014-08-03 01:58+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: pt_PT\n" + +#: wagtail_hooks.py:25 templates/wagtailsnippets/snippets/index.html:3 +msgid "Snippets" +msgstr "Snippets" + +#: templates/wagtailsnippets/chooser/choose.html:2 +msgid "Choose" +msgstr "Escolher" + +#: templates/wagtailsnippets/edit_handlers/snippet_chooser_panel.html:10 +#, python-format +msgid "Choose another %(snippet_type_name)s" +msgstr "Escolher outro %(snippet_type_name)s" + +#: templates/wagtailsnippets/edit_handlers/snippet_chooser_panel.html:11 +#, python-format +msgid "Choose %(snippet_type_name)s" +msgstr "Escolher %(snippet_type_name)s" + +#: templates/wagtailsnippets/snippets/confirm_delete.html:3 +#, python-format +msgid "Delete %(snippet_type_name)s - %(instance)s" +msgstr "Eliminar %(snippet_type_name)s - %(instance)s" + +#: templates/wagtailsnippets/snippets/confirm_delete.html:6 +#: templates/wagtailsnippets/snippets/edit.html:20 +msgid "Delete" +msgstr "Eliminar" + +#: templates/wagtailsnippets/snippets/confirm_delete.html:10 +#, python-format +msgid "Are you sure you want to delete this %(snippet_type_name)s?" +msgstr "Tem a certeza que quer eliminar este %(snippet_type_name)s?" + +#: templates/wagtailsnippets/snippets/confirm_delete.html:13 +msgid "Yes, delete" +msgstr "Sim, eliminar" + +#: templates/wagtailsnippets/snippets/create.html:3 +#, python-format +msgid "New %(snippet_type_name)s" +msgstr "Novo %(snippet_type_name)s" + +#: templates/wagtailsnippets/snippets/create.html:6 +msgid "New" +msgstr "Novo" + +#: templates/wagtailsnippets/snippets/create.html:17 +#: templates/wagtailsnippets/snippets/edit.html:17 +msgid "Save" +msgstr "Guardar" + +#: templates/wagtailsnippets/snippets/edit.html:3 +#, python-format +msgid "Editing %(snippet_type_name)s - %(instance)s" +msgstr "Editando %(snippet_type_name)s - %(instance)s" + +#: templates/wagtailsnippets/snippets/edit.html:6 +msgid "Editing" +msgstr "Editando" + +#: templates/wagtailsnippets/snippets/list.html:8 +#: templates/wagtailsnippets/snippets/usage.html:16 +msgid "Title" +msgstr "Título" + +#: templates/wagtailsnippets/snippets/type_index.html:3 +#, python-format +msgid "Snippets %(snippet_type_name_plural)s" +msgstr "Snippets %(snippet_type_name_plural)s" + +#: templates/wagtailsnippets/snippets/type_index.html:10 +#, python-format +msgid "Snippets %(snippet_type_name_plural)s" +msgstr "Snippets %(snippet_type_name_plural)s" + +#: templates/wagtailsnippets/snippets/type_index.html:13 +#, python-format +msgid "Add %(snippet_type_name)s" +msgstr "Adicionar %(snippet_type_name)s" + +#: templates/wagtailsnippets/snippets/type_index.html:23 +#, python-format +msgid "" +"No %(snippet_type_name_plural)s have been created. Why not add one?" +msgstr "" +"Nenhum %(snippet_type_name_plural)s foi criado. Porque não adicionar um?" + +#: templates/wagtailsnippets/snippets/usage.html:3 +#, python-format +msgid "Usage of %(title)s" +msgstr "Utilização de %(title)s" + +#: templates/wagtailsnippets/snippets/usage.html:5 +msgid "Usage of" +msgstr "Utilização de" + +#: templates/wagtailsnippets/snippets/usage.html:17 +msgid "Parent" +msgstr "Ascendente" + +#: templates/wagtailsnippets/snippets/usage.html:18 +msgid "Type" +msgstr "Tipo" + +#: templates/wagtailsnippets/snippets/usage.html:19 +msgid "Status" +msgstr "Estado" + +#: templates/wagtailsnippets/snippets/usage.html:26 +msgid "Edit this page" +msgstr "Editar esta página" + +#: views/snippets.py:129 +msgid "{snippet_type} '{instance}' created." +msgstr "{snippet_type} '{instance}' atualizado." + +#: views/snippets.py:136 +msgid "The snippet could not be created due to errors." +msgstr "O snippet não pôde ser criado devido a erros." + +#: views/snippets.py:170 +msgid "{snippet_type} '{instance}' updated." +msgstr "{snippet_type} '{instance}' atualizado." + +#: views/snippets.py:177 +msgid "The snippet could not be saved due to errors." +msgstr "O snippet não pôde ser guardado devido a erros." + +#: views/snippets.py:206 +msgid "{snippet_type} '{instance}' deleted." +msgstr "{snippet_type} '{instance}' eliminado." diff --git a/wagtail/wagtailusers/locale/pt_PT/LC_MESSAGES/django.mo b/wagtail/wagtailusers/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..0698c96aa40041b05ba97214c645fab76c3ed8ac GIT binary patch literal 3794 zcmb7`%WoV>8Ndrzc3JZdj|G-Tt(Rb%c*bKVS%PDmgv5yqPGZ>(i&h}3JYAmYY2#=j|(@1a)3W!Ie>%&zpr{cwl~3AT5kWk zy6gMudsTgN|HLCNDy~WHPjY|bZAzVmKYcs@xO(s49lQ;v;Gf`Q@SpHes2)*j3_J$k z1y8_t!YAQ-;ZyJ&oPi?O9e(e@(~SF2Z z;J2XU_eFRD{u-i6y$%VVdO!DPxMi;B{{*+#FBhst*Emm-54psz4{$%tjhdKGpgzSd zYl!`nZ>&36Tl|ts{CSdF*8ep3$GPR2s1ft@S)NJN=+eWdr$%q;cuq2wd=W+^TS;>J zIc_zk4_%vG>#a_Mc7@fsDcjxA=Z8%+Og=f;c2!YYKNV^T8xCYH>MB^Tchj<~%dRQo zurRsRCiB)Ld)nSfLm8UtVmqpVW!ksuVv=YRXU9j;!b6@G^?zi%Dc$hh{wV0K>01^; z{dStA<(@7bMir)GYeP)E3hON=X_*!swVazYQ_JE&6bxcq&xEk+JSGG*xxSs&JI?FA z_32L9Hf8FHrn-{)Q0nWf)ruqAnJJ#v z>5eX3soPysbg;OoR&C#ADlWV>G*sDam}$^i0o8YnBnEP+9*v~1;u92<*qxZhMm-ANx+7r zm?&#K%{VLOoBGX?n5u27+f=v2G^x6R&Bsm<+G_UzGT==!R2;g#w>jaD@a-2WZ0IQJt-OF ziWo+n?MJ$(@@+}N(NG^`r>Snr)}DBw_3ep$caOZQdWnRfekXfA3Iw(0o#ef-k~F@? z0+iakezrDUx0+|0t+936bG~d`3!OA+e7Wj`#-^LsV{11y8XUDyrW+@3d~s&YvC5ll|7%^ri@z947PnD=t{QN_E?! z?exMeh8MEou(=zS##Y&b6&t6qX-$qv*H*4AA9yi~?Ux9qEl|7H!@knqDQ9{a(LEmv zJJ@pZ=H`{gxr2GK{EqdFWtL2+!g+meJ1xi7vdWvRamD#O% zd)g*##$(qZ>BH|wDj#SFETe8vvC=1EPvC{+5FXsi<-oH(PeT~|Om?(4y2EKMX0bSX znm~*c+hKp8^xd#QtQ4hpNp;ttD7S%_1zU6(N#jUyFRI*c5QCqyN|Q=YbDMgnuj4X@ z5;B>M?j>%TU`X^wi&86|p!|PU(mG<;20zKlGatDm5I~#jZHkLRmY|E+z$apoWgr`JtW2*?(-4S`IkEhM|K?B?dA>89Pq)w#j=u$CS5S z%7#vC-c&aZSy6xN4So~z%P#Qb%aQGV3J4d zO8-KN;I6T2Xuq{7Z?%o>pAIJLRC(Ra2!xexhC0);1(E3SBPMQa>h&S1BR1`WY>$3M g(5OaP8nrbE%R@f!`@qx(TT{vAK6-u}QbfA{3-W9~YXATM literal 0 HcmV?d00001 diff --git a/wagtail/wagtailusers/locale/pt_PT/LC_MESSAGES/django.po b/wagtail/wagtailusers/locale/pt_PT/LC_MESSAGES/django.po new file mode 100644 index 000000000..abd1de940 --- /dev/null +++ b/wagtail/wagtailusers/locale/pt_PT/LC_MESSAGES/django.po @@ -0,0 +1,206 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Thiago Cangussu , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Wagtail 0.5.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-01 16:39+0100\n" +"PO-Revision-Date: 2014-08-03 01:59+0100\n" +"Last-Translator: Jose Lourenco \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: pt_PT\n" + +#: forms.py:18 forms.py:95 +msgid "Administrator" +msgstr "Administrador" + +#: forms.py:20 +msgid "If ticked, this user has the ability to manage user accounts." +msgstr "" +"Se selecionado, este utilizador terá permissão para gerir contas de " +"utilizadores." + +#: forms.py:23 forms.py:80 +msgid "Email" +msgstr "Email" + +#: forms.py:24 forms.py:81 +msgid "First Name" +msgstr "Primeiro Nome" + +#: forms.py:25 forms.py:82 +msgid "Last Name" +msgstr "Último nome" + +#: forms.py:68 +msgid "A user with that username already exists." +msgstr "Um utilizador com esse nome já existe." + +#: forms.py:69 +msgid "The two password fields didn't match." +msgstr "As senhas nos dois campos não coincidem." + +#: forms.py:72 templates/wagtailusers/list.html:15 +msgid "Username" +msgstr "Nome de utilizador" + +#: forms.py:75 +msgid "Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only." +msgstr "" +"Obrigatório. 30 caracteres ou menos. Somente letras, números e @/./+/-/_." + +#: forms.py:77 +msgid "This value may contain only letters, numbers and @/./+/-/_ characters." +msgstr "" +"Este valor apenas pode conter letras, números e os caracteres @/./+/-/_." + +#: forms.py:85 +msgid "Password" +msgstr "Senha" + +#: forms.py:88 +msgid "Leave blank if not changing." +msgstr "Deixar em branco se não houver alteração" + +#: forms.py:90 +msgid "Password confirmation" +msgstr "Confirmação de senha" + +#: forms.py:92 +msgid "Enter the same password as above, for verification." +msgstr "Introduza a mesma senha anterior para verificação." + +#: forms.py:97 +msgid "Administrators have the ability to manage user accounts." +msgstr "Os administradores têm a permissão para gerir contas de utilizadores." + +#: models.py:13 +msgid "Receive notification when a page is submitted for moderation" +msgstr "Receber notificação quando uma página for enviada para moderação" + +#: models.py:18 +msgid "Receive notification when your page edit is approved" +msgstr "Receber notificação quando a edição da sua página for aprovada" + +#: models.py:23 +msgid "Receive notification when your page edit is rejected" +msgstr "Receber notificação quando a edição da sua página for rejeitada" + +#: wagtail_hooks.py:22 templates/wagtailusers/index.html:4 +#: templates/wagtailusers/index.html:17 +msgid "Users" +msgstr "Utilizadores" + +#: templates/wagtailusers/create.html:4 templates/wagtailusers/create.html:8 +#: templates/wagtailusers/create.html:35 +msgid "Add user" +msgstr "Adicionar utilizador" + +#: templates/wagtailusers/create.html:12 templates/wagtailusers/edit.html:12 +msgid "Account" +msgstr "Conta" + +#: templates/wagtailusers/create.html:13 templates/wagtailusers/create.html:28 +#: templates/wagtailusers/edit.html:13 +msgid "Roles" +msgstr "Funções (roles)" + +#: templates/wagtailusers/edit.html:4 templates/wagtailusers/edit.html.py:8 +msgid "Editing" +msgstr "Editando" + +#: templates/wagtailusers/edit.html:30 templates/wagtailusers/edit.html:37 +msgid "Save" +msgstr "Guardar" + +#: templates/wagtailusers/index.html:18 +msgid "Add a user" +msgstr "Adicionar um utilizador" + +#: templates/wagtailusers/list.html:7 +msgid "Name" +msgstr "Nome" + +#: templates/wagtailusers/list.html:22 +msgid "Level" +msgstr "Nível" + +#: templates/wagtailusers/list.html:23 +msgid "Status" +msgstr "Estado" + +#: templates/wagtailusers/list.html:36 +msgid "Admin" +msgstr "Admin" + +#: templates/wagtailusers/list.html:37 +msgid "Active" +msgstr "Ativo" + +#: templates/wagtailusers/list.html:37 +msgid "Inactive" +msgstr "Inativo" + +#: templates/wagtailusers/results.html:5 +#, python-format +msgid "" +"\n" +" There is one match\n" +" " +msgid_plural "" +"\n" +" There are %(counter)s matches\n" +" " +msgstr[0] "" +"\n" +" Existe uma correspondência\n" +" " +msgstr[1] "" +"\n" +" Existem %(counter)s correspondências\n" +" " + +#: templates/wagtailusers/results.html:18 +#, python-format +msgid "Sorry, no users match \"%(query_string)s\"" +msgstr "" +"Desculpe, nenhum utilizador corresponde a \"%(query_string)s\"" + +#: templates/wagtailusers/results.html:21 +#, python-format +msgid "" +"There are no users configured. Why not add some?" +msgstr "" +"Não existem utilizadores configurados. Por que não adicionar algum?" + +#: views/users.py:30 views/users.py:37 +msgid "Search users" +msgstr "Procurar utilizadores" + +#: views/users.py:84 +msgid "User '{0}' created." +msgstr "Utilizador '{0}' criado." + +#: views/users.py:87 +msgid "The user could not be created due to errors." +msgstr "O utilizador não pôde ser criado devido a erros." + +#: views/users.py:103 +msgid "User '{0}' updated." +msgstr "Utilizador '{0}' atualizado." + +#: views/users.py:106 +msgid "The user could not be saved due to errors." +msgstr "O utilizador não pôde ser guardado devido a erros." From 2afb9fe84e79bd07b2479fc2a1dce8c21c5e08c0 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 19 Aug 2014 10:31:02 +0100 Subject: [PATCH 29/66] Completely removed all features deprecated in 0.4 --- wagtail/tests/models.py | 45 ------------------- wagtail/wagtailcore/models.py | 19 -------- wagtail/wagtailcore/tests/test_page_model.py | 9 ---- wagtail/wagtailcore/views.py | 5 +-- wagtail/wagtailsearch/indexed.py | 10 ----- .../management/commands/update_index.py | 3 -- .../wagtailsearch/tests/test_indexed_class.py | 10 ----- 7 files changed, 1 insertion(+), 100 deletions(-) diff --git a/wagtail/tests/models.py b/wagtail/tests/models.py index feb5b3156..26c1af847 100644 --- a/wagtail/tests/models.py +++ b/wagtail/tests/models.py @@ -419,51 +419,6 @@ class SearchTestChild(SearchTest): ] -class SearchTestOldConfig(models.Model, indexed.Indexed): - """ - This tests that the Indexed class can correctly handle models that - use the old "indexed_fields" configuration format. - - This format was deprecated in 0.4 and removed in 0.6 - """ - indexed_fields = { - # A search field with predictive search and boosting - 'title': { - 'type': 'string', - 'analyzer': 'edgengram_analyzer', - 'boost': 100, - }, - - # A filter field - 'live': { - 'type': 'boolean', - 'index': 'not_analyzed', - }, - } - - -class SearchTestOldConfigAndNewConfig(models.Model, indexed.Indexed): - """ - This tests that the Indexed class can correctly handle models that - use both the old "indexed_fields" and the new "search_fields" configuration - format. - - Usually, when wagtailsearch detects that "indexed_fields" is being used, it - will raise a RuntimeError. - - This behaviour may get in the way of people developing apps that support - older versions of Wagtail. So Wagtail allows "indexed_fields" to be defined - on a classes as long as they also define "search_fields" as well. Wagtail 0.4+ - will simply ignore the "indexed_fields" attribute in this case. - """ - indexed_fields = ['title', 'content'] - - search_fields = ( - indexed.SearchField('title'), - indexed.SearchField('content'), - ) - - def routable_page_external_view(request, arg): return HttpResponse("EXTERNAL VIEW: " + arg) diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index 74429e0ab..305e07c23 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -693,19 +693,6 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index for example, a page containing a form might have a default view of the form, and a post-submission 'thankyou' page """ - modes = self.get_page_modes(i_know_what_im_doing=True) - if modes is not Page.DEFAULT_PREVIEW_MODES: - # User has overriden get_page_modes instead of using preview_modes - raise RuntimeError("get_page_modes has been removed. Define a preview_modes property instead.") - - return modes - - def get_page_modes(self, i_know_what_im_doing=False): - # Raise error if this was called directly - if not i_know_what_im_doing: - raise RuntimeError("get_page_modes has been removed. Use the preview_modes property instead.") - - # Deprecated accessor for the preview_modes property return Page.DEFAULT_PREVIEW_MODES @property @@ -739,12 +726,6 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index """ return self.serve(request) - def show_as_mode(self, mode_name): - # Deprecated API for rendering previews. If this returns something other than None, - # we know that a subclass of Page has overridden this, and we should try to work with - # that response if possible. - return None - def get_cached_paths(self): """ This returns a list of paths to invalidate in a frontend cache diff --git a/wagtail/wagtailcore/tests/test_page_model.py b/wagtail/wagtailcore/tests/test_page_model.py index 5cb21152a..211c8f8a3 100644 --- a/wagtail/wagtailcore/tests/test_page_model.py +++ b/wagtail/wagtailcore/tests/test_page_model.py @@ -280,15 +280,6 @@ class TestServeView(TestCase): self.assertNotContains(response, '

    Events

    ') self.assertContains(response, 'Christmas') - - def test_old_style_routing(self): - """ - Test that route() methods that return an HttpResponse are correctly handled - - Old style routing was deprecated in Wagtail 0.4 and removed in 0.6 - """ - self.assertRaises(RuntimeError, self.client.get, '/old-style-route/') - def test_before_serve_hook(self): response = self.client.get('/events/', HTTP_USER_AGENT='GoogleBot') self.assertContains(response, 'bad googlebot no cookie') diff --git a/wagtail/wagtailcore/views.py b/wagtail/wagtailcore/views.py index e4c370ff6..f01390b83 100644 --- a/wagtail/wagtailcore/views.py +++ b/wagtail/wagtailcore/views.py @@ -17,11 +17,8 @@ def serve(request, path): raise Http404 path_components = [component for component in path.split('/') if component] - route_result = request.site.root_page.specific.route(request, path_components) - if isinstance(route_result, HttpResponse): - raise RuntimeError("Page.route should return an instance of wagtailcore.url_routing.RouteResult, not an HttpResponse") + page, args, kwargs = request.site.root_page.specific.route(request, path_components) - (page, args, kwargs) = route_result for fn in hooks.get_hooks('before_serve_page'): result = fn(page, request, args, kwargs) if isinstance(result, HttpResponse): diff --git a/wagtail/wagtailsearch/indexed.py b/wagtail/wagtailsearch/indexed.py index a8e5c5e42..09eed9d94 100644 --- a/wagtail/wagtailsearch/indexed.py +++ b/wagtail/wagtailsearch/indexed.py @@ -37,16 +37,6 @@ class Indexed(object): @classmethod def get_search_fields(cls): - # Raise an error if the 'indexed_fields' attribute is being used on a class without 'search_fields' - # Note: We still allow people to define 'indexed_fields' as long as they also define 'search_fields' - # on the same class. This allows people to still write code that is compatible with older versions - # of Wagtail and we still catch issues where code using the old 'indexed_fields' setting hasn't been - # updated. - if 'indexed_fields' in cls.__dict__ and not 'search_fields' in cls.__dict__: - raise RuntimeError("The indexed_fields attribute has been replaced with search_fields. " \ - "Please update %s.%s to use the search_fields setting." % (cls._meta.app_label, cls.__name__)) - - # Return value of 'search_fields' attribute return getattr(cls, 'search_fields', tuple()) @classmethod diff --git a/wagtail/wagtailsearch/management/commands/update_index.py b/wagtail/wagtailsearch/management/commands/update_index.py index 8c587f2fd..c52b75639 100644 --- a/wagtail/wagtailsearch/management/commands/update_index.py +++ b/wagtail/wagtailsearch/management/commands/update_index.py @@ -12,9 +12,6 @@ class Command(BaseCommand): # Get list of indexed models indexed_models = [model for model in models.get_models() if issubclass(model, Indexed)] - # HACK: Make sure SearchTestOldConfig model is not in indexed_models to prevent test failures - indexed_models = [model for model in indexed_models if model.__name__ != 'SearchTestOldConfig'] - # Object set object_set = {} diff --git a/wagtail/wagtailsearch/tests/test_indexed_class.py b/wagtail/wagtailsearch/tests/test_indexed_class.py index b89b94a03..c2cbc2935 100644 --- a/wagtail/wagtailsearch/tests/test_indexed_class.py +++ b/wagtail/wagtailsearch/tests/test_indexed_class.py @@ -15,13 +15,3 @@ class TestContentTypeNames(TestCase): def test_qualified_content_type_name(self): name = models.SearchTestChild.indexed_get_content_type() self.assertEqual(name, 'tests_searchtest_tests_searchtestchild') - - -class TestIndexedFieldsBackwardsIncompatibility(TestCase, WagtailTestUtils): - def test_use_of_indexed_fields_raises_error(self): - # SearchTestOldConfig.get_search_fields should raise a RuntimeError - self.assertRaises(RuntimeError, models.SearchTestOldConfig.get_search_fields) - - def test_use_of_indexed_fields_with_search_fields_doesnt_raise_error(self): - # SearchTestOldConfigAndNewConfig.get_search_fields shouldnt raise an error - search_fields = models.SearchTestOldConfigAndNewConfig.get_search_fields() From 470a9e43962c69896fe60110eae2dfa187073d75 Mon Sep 17 00:00:00 2001 From: pvetch Date: Tue, 19 Aug 2014 10:51:52 +0100 Subject: [PATCH 30/66] Update routable_page.rst tiny text fix --- docs/core_components/pages/advanced_topics/routable_page.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core_components/pages/advanced_topics/routable_page.rst b/docs/core_components/pages/advanced_topics/routable_page.rst index 465b0b148..c3e2625c9 100644 --- a/docs/core_components/pages/advanced_topics/routable_page.rst +++ b/docs/core_components/pages/advanced_topics/routable_page.rst @@ -40,7 +40,7 @@ Here's an example of an ``EventPage`` with three views: def past_events(self, request): """ - View function for the current events page + View function for the past events page """ ... From 26314bdfc7abec48685aafca6752f99721763330 Mon Sep 17 00:00:00 2001 From: pvetch Date: Tue, 19 Aug 2014 10:52:49 +0100 Subject: [PATCH 31/66] Update using_images_outside_wagtail.rst Fix to code block syntax --- docs/core_components/images/using_images_outside_wagtail.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core_components/images/using_images_outside_wagtail.rst b/docs/core_components/images/using_images_outside_wagtail.rst index 5671e8504..d3b63126b 100644 --- a/docs/core_components/images/using_images_outside_wagtail.rst +++ b/docs/core_components/images/using_images_outside_wagtail.rst @@ -71,7 +71,7 @@ Using the URLs on your website or blog Once you have generated a URL, you can put it straight into the ``src`` attribute of an ```` tag: -..code-block:: html + .. code-block:: html From 15419f4d0e405141e5388f1909e86acca872b0ed Mon Sep 17 00:00:00 2001 From: Tim Heap Date: Thu, 21 Aug 2014 10:08:29 +1000 Subject: [PATCH 32/66] Make RoutablePage a mixin If a developer wanted to have a site-wide base page class, and also have some pages be `RoutablePage`s, a conflict between the automatically generated `page_ptr` fields would occur. ```python from wagtail.wagtailcore.models import Page from wagtail.contrib.wagtailroutablepage.models import RoutablePage class SitePageBase(Page): # common functionality is_abstract = True class Meta: abstract = True class MyPage(RoutablePage, SitePageBase): # This model is invalid pass ``` `RoutablePage` has been changed to be a mixin `RoutablePageMixin`. Page classes can use this to gain the `RoutablePage` functionality while still retaining the ability to subclass other models. A `RoutablePage` class that derives from both `RoutablePageMixin` and `Page` has been left in for backwards compatibility, so old code will continue to function without any modifications. --- ...table_page.rst => routable_page_mixin.rst} | 23 +++++++++++-------- docs/core_components/pages/index.rst | 2 +- docs/releases/0.5.rst | 4 ++-- wagtail/contrib/wagtailroutablepage/models.py | 14 ++++++++--- 4 files changed, 27 insertions(+), 16 deletions(-) rename docs/core_components/pages/advanced_topics/{routable_page.rst => routable_page_mixin.rst} (66%) diff --git a/docs/core_components/pages/advanced_topics/routable_page.rst b/docs/core_components/pages/advanced_topics/routable_page_mixin.rst similarity index 66% rename from docs/core_components/pages/advanced_topics/routable_page.rst rename to docs/core_components/pages/advanced_topics/routable_page_mixin.rst index c3e2625c9..36ca024c3 100644 --- a/docs/core_components/pages/advanced_topics/routable_page.rst +++ b/docs/core_components/pages/advanced_topics/routable_page_mixin.rst @@ -1,4 +1,4 @@ -.. _routable_page: +.. _routable_page_mixin: ==================================== Embedding URL configuration in Pages @@ -6,15 +6,15 @@ Embedding URL configuration in Pages .. versionadded:: 0.5 -The ``RoutablePage`` class provides a convenient way for a page to respond on multiple sub-URLs with different views. For example, a blog section on a site might provide several different types of index page at URLs like ``/blog/2013/06/``, ``/blog/authors/bob/``, ``/blog/tagged/python/``, all served by the same ``BlogIndex`` page. +The ``RoutablePageMixin`` mixin provides a convenient way for a page to respond on multiple sub-URLs with different views. For example, a blog section on a site might provide several different types of index page at URLs like ``/blog/2013/06/``, ``/blog/authors/bob/``, ``/blog/tagged/python/``, all served by the same ``BlogIndex`` page. -A ``RoutablePage`` exists within the page tree like any other page, but URL paths underneath it are checked against a list of patterns, using Django's urlconf scheme. If none of the patterns match, control is passed to subpages as usual (or failing that, a 404 error is thrown). +A ``Page`` using ``RoutablePageMixin`` exists within the page tree like any other page, but URL paths underneath it are checked against a list of patterns, using Django's urlconf scheme. If none of the patterns match, control is passed to subpages as usual (or failing that, a 404 error is thrown). The basics ========== -To use ``RoutablePage``, you need to make your class inherit from :class:`wagtail.contrib.wagtailroutablepage.models.RoutablePage` and configure the ``subpage_urls`` attribute with your URL configuration. +To use ``RoutablePageMixin``, you need to make your class inherit from both :class:`wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin` and :class:`wagtail.wagtailcore.models.Page`, and configure the ``subpage_urls`` attribute with your URL configuration. Here's an example of an ``EventPage`` with three views: @@ -22,10 +22,11 @@ Here's an example of an ``EventPage`` with three views: from django.conf.urls import url - from wagtail.contrib.wagtailroutablepage.models import RoutablePage + from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin + from wagtail.wagtailcore.models import Page - class EventPage(RoutablePage): + class EventPage(RoutablePageMixin, Page): subpage_urls = ( url(r'^$', 'current_events', name='current_events'), url(r'^past/$', 'past_events', name='past_events'), @@ -51,11 +52,11 @@ Here's an example of an ``EventPage`` with three views: ... -The ``RoutablePage`` class -========================== +The ``RoutablePageMixin`` class +=============================== .. automodule:: wagtail.contrib.wagtailroutablepage.models -.. autoclass:: RoutablePage +.. autoclass:: RoutablePageMixin .. autoattribute:: subpage_urls @@ -65,7 +66,9 @@ The ``RoutablePage`` class from django.conf.urls import url - class MyPage(RoutablePage): + from wagtail.wagtailcore.models import Page + + class MyPage(RoutablePageMixin, Page): subpage_urls = ( url(r'^$', 'serve', name='main'), url(r'^archive/$', 'archive', name='archive'), diff --git a/docs/core_components/pages/index.rst b/docs/core_components/pages/index.rst index 1f350f35c..70d20d116 100644 --- a/docs/core_components/pages/index.rst +++ b/docs/core_components/pages/index.rst @@ -21,4 +21,4 @@ The presentation of your content, the actual webpages, includes the normal use o editing_api advanced_topics/queryset_methods advanced_topics/private_pages - advanced_topics/routable_page + advanced_topics/routable_page_mixin diff --git a/docs/releases/0.5.rst b/docs/releases/0.5.rst index 1e440e27f..6f4912de5 100644 --- a/docs/releases/0.5.rst +++ b/docs/releases/0.5.rst @@ -37,7 +37,7 @@ RoutablePage A ``RoutablePage`` model has been added to allow embedding Django-style URL routing within a page. -:ref:`routable_page` +:ref:`routable_page_mixin` Usage stats for images, documents and snippets @@ -129,4 +129,4 @@ South upgraded to 1.0 In preparation for Django 1.7 support in a future release, Wagtail now depends on South 1.0, and its migration files have been moved from ``migrations`` to ``south_migrations``. Older versions of South will fail to find the migrations in the new location. -If your project's requirements file (most commonly requirements.txt or requirements/base.txt) references a specific older version of South, this must be updated to South 1.0. \ No newline at end of file +If your project's requirements file (most commonly requirements.txt or requirements/base.txt) references a specific older version of South, this must be updated to South 1.0. diff --git a/wagtail/contrib/wagtailroutablepage/models.py b/wagtail/contrib/wagtailroutablepage/models.py index 926e5f48a..88379b37a 100644 --- a/wagtail/contrib/wagtailroutablepage/models.py +++ b/wagtail/contrib/wagtailroutablepage/models.py @@ -8,9 +8,10 @@ from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.url_routing import RouteResult -class RoutablePage(Page): +class RoutablePageMixin(object): """ - This class extends Page by adding methods to allow urlconfs to be embedded inside pages + This class can be mixed in to a Page subclass to allow urlconfs to be + embedded inside pages. """ #: Set this to a tuple of ``django.conf.urls.url`` objects. subpage_urls = None @@ -59,7 +60,7 @@ class RoutablePage(Page): except Http404: pass - return super(RoutablePage, self).route(request, path_components) + return super(RoutablePageMixin, self).route(request, path_components) def serve(self, request, view, args, kwargs): return view(request, *args, **kwargs) @@ -68,6 +69,13 @@ class RoutablePage(Page): view, args, kwargs = self.resolve_subpage('/') return view(*args, **kwargs) + +class RoutablePage(RoutablePageMixin, Page): + """ + This class extends Page by adding methods to allow urlconfs + to be embedded inside pages + """ + is_abstract = True class Meta: From 8a19552033e26cf437308165d4b8c9bdd73e1b12 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Thu, 21 Aug 2014 12:19:39 +0100 Subject: [PATCH 33/66] Changelog and release notes for #560 --- CHANGELOG.txt | 1 + docs/releases/0.6.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7530812f6..803ad742d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ Changelog 0.6 (xx.xx.20xx) ~~~~~~~~~~~~~~~~ * Added {% routablepageurl %} template tag (@timheap) + * Added RoutablePageMixin (@timheap) * Fix: Page URL generation now returns correct URLs for sites that have the main 'serve' view rooted somewhere other than '/' 0.5 (01.08.2014) diff --git a/docs/releases/0.6.rst b/docs/releases/0.6.rst index 5ab1769da..321c43730 100644 --- a/docs/releases/0.6.rst +++ b/docs/releases/0.6.rst @@ -13,6 +13,7 @@ What's new Minor features ~~~~~~~~~~~~~~ * A new template tag has been added for reversing URLs inside routable pages. See :ref:`routablepageurl_template_tag`. + * RoutablePage can now be used as a mixin. See :class:`wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin`. Bug fixes ~~~~~~~~~ From c5fef182e5892517895dc062eb23939e1c186ee8 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Thu, 21 Aug 2014 12:19:57 +0100 Subject: [PATCH 34/66] Fixed a couple of documentation links in the readme --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 5fa7f47f9..f06776221 100644 --- a/README.rst +++ b/README.rst @@ -24,8 +24,8 @@ Wagtail is a Django content management system built originally for the `Royal Co * Support for tree-based content organisation * Optional preview->submit->approve workflow * Fast out of the box. `Varnish `_-friendly if you need it -* A simple `form builder `_ -* Optional `static site generation `_ +* A simple `form builder `_ +* Optional `static site generation `_ * Excellent `test coverage `_ Find out more at `wagtail.io `_. From ccf89700d7152581e2b3fa2c9bdae8eeec28effd Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Thu, 21 Aug 2014 14:54:42 +0100 Subject: [PATCH 35/66] Renamed wagtailsearch.indexed to wagtailsearch.index --- wagtail/wagtailsearch/index.py | 182 +++++++++++++++++++++++++++++++ wagtail/wagtailsearch/indexed.py | 182 +------------------------------ 2 files changed, 187 insertions(+), 177 deletions(-) create mode 100644 wagtail/wagtailsearch/index.py diff --git a/wagtail/wagtailsearch/index.py b/wagtail/wagtailsearch/index.py new file mode 100644 index 000000000..e775ff5c7 --- /dev/null +++ b/wagtail/wagtailsearch/index.py @@ -0,0 +1,182 @@ +import warnings + +from six import string_types + +from django.db import models + +from wagtail.utils.deprecation import RemovedInWagtail06Warning + + +class Indexed(object): + @classmethod + def indexed_get_parent(cls, require_model=True): + for base in cls.__bases__: + if issubclass(base, Indexed) and (issubclass(base, models.Model) or require_model is False): + return base + + @classmethod + def indexed_get_content_type(cls): + # Work out content type + content_type = (cls._meta.app_label + '_' + cls.__name__).lower() + + # Get parent content type + parent = cls.indexed_get_parent() + if parent: + parent_content_type = parent.indexed_get_content_type() + return parent_content_type + '_' + content_type + else: + return content_type + + @classmethod + def indexed_get_toplevel_content_type(cls): + # Get parent content type + parent = cls.indexed_get_parent() + if parent: + return parent.indexed_get_content_type() + else: + # At toplevel, return this content type + return (cls._meta.app_label + '_' + cls.__name__).lower() + + @classmethod + def indexed_get_indexed_fields(cls): + # Get indexed fields for this class as dictionary + indexed_fields = cls.indexed_fields + if isinstance(indexed_fields, dict): + # Make sure we have a copy to prevent us accidentally changing the configuration + indexed_fields = indexed_fields.copy() + else: + # Convert to dict + if isinstance(indexed_fields, tuple): + indexed_fields = list(indexed_fields) + if isinstance(indexed_fields, string_types): + indexed_fields = [indexed_fields] + if isinstance(indexed_fields, list): + indexed_fields = dict((field, dict(type='string')) for field in indexed_fields) + if not isinstance(indexed_fields, dict): + raise ValueError() + + # Get indexed fields for parent class + parent = cls.indexed_get_parent(require_model=False) + if parent: + # Add parent fields into this list + parent_indexed_fields = parent.indexed_get_indexed_fields().copy() + parent_indexed_fields.update(indexed_fields) + indexed_fields = parent_indexed_fields + return indexed_fields + + @classmethod + def get_search_fields(cls): + search_fields = [] + + if hasattr(cls, 'search_fields'): + search_fields.extend(cls.search_fields) + + # Backwards compatibility with old indexed_fields setting + + # Get indexed fields + indexed_fields = cls.indexed_get_indexed_fields() + + # Display deprecation warning if indexed_fields has been used + if indexed_fields: + warnings.warn("'indexed_fields' setting is now deprecated." + "Use 'search_fields' instead.", RemovedInWagtail06Warning) + + # Convert them into search fields + for field_name, _config in indexed_fields.items(): + # Copy the config to prevent is trashing anything accidentally + config = _config.copy() + + # Check if this is a filter field + if config.get('index', None) == 'not_analyzed': + config.pop('index') + search_fields.append(FilterField(field_name, es_extra=config)) + continue + + # Must be a search field, check for boosting and partial matching + boost = config.pop('boost', None) + + partial_match = False + if config.get('analyzer', None) == 'edgengram_analyzer': + partial_match = True + config.pop('analyzer') + + # Add the field + search_fields.append(SearchField(field_name, boost=boost, partial_match=partial_match, es_extra=config)) + + # Remove any duplicate entries into search fields + # We need to take into account that fields can be indexed as both a SearchField and as a FilterField + search_fields_dict = {} + for field in search_fields: + search_fields_dict[(field.field_name, type(field))] = field + search_fields = search_fields_dict.values() + + return search_fields + + @classmethod + def get_searchable_search_fields(cls): + return filter(lambda field: isinstance(field, SearchField), cls.get_search_fields()) + + @classmethod + def get_filterable_search_fields(cls): + return filter(lambda field: isinstance(field, FilterField), cls.get_search_fields()) + + @classmethod + def get_indexed_objects(cls): + return cls.objects.all() + + indexed_fields = () + + +class BaseField(object): + suffix = '' + + def __init__(self, field_name, **kwargs): + self.field_name = field_name + self.kwargs = kwargs + + def get_field(self, cls): + return cls._meta.get_field_by_name(self.field_name)[0] + + def get_attname(self, cls): + try: + field = self.get_field(cls) + return field.attname + except models.fields.FieldDoesNotExist: + return self.field_name + + def get_index_name(self, cls): + return self.get_attname(cls) + self.suffix + + def get_type(self, cls): + if 'type' in self.kwargs: + return self.kwargs['type'] + + try: + field = self.get_field(cls) + return field.get_internal_type() + except models.fields.FieldDoesNotExist: + return 'CharField' + + def get_value(self, obj): + try: + field = self.get_field(obj.__class__) + return field._get_val_from_obj(obj) + except models.fields.FieldDoesNotExist: + value = getattr(obj, self.field_name, None) + if hasattr(value, '__call__'): + value = value() + return value + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.field_name) + + +class SearchField(BaseField): + def __init__(self, field_name, boost=None, partial_match=False, **kwargs): + super(SearchField, self).__init__(field_name, **kwargs) + self.boost = boost + self.partial_match = partial_match + + +class FilterField(BaseField): + suffix = '_filter' diff --git a/wagtail/wagtailsearch/indexed.py b/wagtail/wagtailsearch/indexed.py index e775ff5c7..2828d5e3c 100644 --- a/wagtail/wagtailsearch/indexed.py +++ b/wagtail/wagtailsearch/indexed.py @@ -1,182 +1,10 @@ import warnings -from six import string_types - -from django.db import models - -from wagtail.utils.deprecation import RemovedInWagtail06Warning +from wagtail.utils.deprecation import RemovedInWagtail08Warning -class Indexed(object): - @classmethod - def indexed_get_parent(cls, require_model=True): - for base in cls.__bases__: - if issubclass(base, Indexed) and (issubclass(base, models.Model) or require_model is False): - return base +warnings.warn( + "The wagtail.wagtailsearch.indexed module has been renamed. " + "Use wagtail.wagtailsearch.index instead.", RemovedInWagtail08Warning) - @classmethod - def indexed_get_content_type(cls): - # Work out content type - content_type = (cls._meta.app_label + '_' + cls.__name__).lower() - - # Get parent content type - parent = cls.indexed_get_parent() - if parent: - parent_content_type = parent.indexed_get_content_type() - return parent_content_type + '_' + content_type - else: - return content_type - - @classmethod - def indexed_get_toplevel_content_type(cls): - # Get parent content type - parent = cls.indexed_get_parent() - if parent: - return parent.indexed_get_content_type() - else: - # At toplevel, return this content type - return (cls._meta.app_label + '_' + cls.__name__).lower() - - @classmethod - def indexed_get_indexed_fields(cls): - # Get indexed fields for this class as dictionary - indexed_fields = cls.indexed_fields - if isinstance(indexed_fields, dict): - # Make sure we have a copy to prevent us accidentally changing the configuration - indexed_fields = indexed_fields.copy() - else: - # Convert to dict - if isinstance(indexed_fields, tuple): - indexed_fields = list(indexed_fields) - if isinstance(indexed_fields, string_types): - indexed_fields = [indexed_fields] - if isinstance(indexed_fields, list): - indexed_fields = dict((field, dict(type='string')) for field in indexed_fields) - if not isinstance(indexed_fields, dict): - raise ValueError() - - # Get indexed fields for parent class - parent = cls.indexed_get_parent(require_model=False) - if parent: - # Add parent fields into this list - parent_indexed_fields = parent.indexed_get_indexed_fields().copy() - parent_indexed_fields.update(indexed_fields) - indexed_fields = parent_indexed_fields - return indexed_fields - - @classmethod - def get_search_fields(cls): - search_fields = [] - - if hasattr(cls, 'search_fields'): - search_fields.extend(cls.search_fields) - - # Backwards compatibility with old indexed_fields setting - - # Get indexed fields - indexed_fields = cls.indexed_get_indexed_fields() - - # Display deprecation warning if indexed_fields has been used - if indexed_fields: - warnings.warn("'indexed_fields' setting is now deprecated." - "Use 'search_fields' instead.", RemovedInWagtail06Warning) - - # Convert them into search fields - for field_name, _config in indexed_fields.items(): - # Copy the config to prevent is trashing anything accidentally - config = _config.copy() - - # Check if this is a filter field - if config.get('index', None) == 'not_analyzed': - config.pop('index') - search_fields.append(FilterField(field_name, es_extra=config)) - continue - - # Must be a search field, check for boosting and partial matching - boost = config.pop('boost', None) - - partial_match = False - if config.get('analyzer', None) == 'edgengram_analyzer': - partial_match = True - config.pop('analyzer') - - # Add the field - search_fields.append(SearchField(field_name, boost=boost, partial_match=partial_match, es_extra=config)) - - # Remove any duplicate entries into search fields - # We need to take into account that fields can be indexed as both a SearchField and as a FilterField - search_fields_dict = {} - for field in search_fields: - search_fields_dict[(field.field_name, type(field))] = field - search_fields = search_fields_dict.values() - - return search_fields - - @classmethod - def get_searchable_search_fields(cls): - return filter(lambda field: isinstance(field, SearchField), cls.get_search_fields()) - - @classmethod - def get_filterable_search_fields(cls): - return filter(lambda field: isinstance(field, FilterField), cls.get_search_fields()) - - @classmethod - def get_indexed_objects(cls): - return cls.objects.all() - - indexed_fields = () - - -class BaseField(object): - suffix = '' - - def __init__(self, field_name, **kwargs): - self.field_name = field_name - self.kwargs = kwargs - - def get_field(self, cls): - return cls._meta.get_field_by_name(self.field_name)[0] - - def get_attname(self, cls): - try: - field = self.get_field(cls) - return field.attname - except models.fields.FieldDoesNotExist: - return self.field_name - - def get_index_name(self, cls): - return self.get_attname(cls) + self.suffix - - def get_type(self, cls): - if 'type' in self.kwargs: - return self.kwargs['type'] - - try: - field = self.get_field(cls) - return field.get_internal_type() - except models.fields.FieldDoesNotExist: - return 'CharField' - - def get_value(self, obj): - try: - field = self.get_field(obj.__class__) - return field._get_val_from_obj(obj) - except models.fields.FieldDoesNotExist: - value = getattr(obj, self.field_name, None) - if hasattr(value, '__call__'): - value = value() - return value - - def __repr__(self): - return '<%s: %s>' % (self.__class__.__name__, self.field_name) - - -class SearchField(BaseField): - def __init__(self, field_name, boost=None, partial_match=False, **kwargs): - super(SearchField, self).__init__(field_name, **kwargs) - self.boost = boost - self.partial_match = partial_match - - -class FilterField(BaseField): - suffix = '_filter' +from .index import * From e898bc1d7829490ba3c02ab890f4cc48de320a14 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Thu, 21 Aug 2014 15:16:06 +0100 Subject: [PATCH 36/66] Updated references to old indexed class to point to index instead --- wagtail/tests/models.py | 24 +++++++++---------- wagtail/utils/deprecation.py | 4 ++++ wagtail/wagtailadmin/taggable.py | 8 +++---- wagtail/wagtailcore/models.py | 18 +++++++------- wagtail/wagtaildocs/models.py | 4 ++-- wagtail/wagtailimages/models.py | 4 ++-- wagtail/wagtailsearch/__init__.py | 2 +- wagtail/wagtailsearch/backends/base.py | 2 +- wagtail/wagtailsearch/backends/db.py | 1 - .../wagtailsearch/backends/elasticsearch.py | 2 +- wagtail/wagtailsearch/indexed.py | 1 + wagtail/wagtailsearch/models.py | 1 - wagtail/wagtailsearch/signal_handlers.py | 2 +- .../wagtailsearch/tests/test_indexed_class.py | 14 +++++------ 14 files changed, 45 insertions(+), 42 deletions(-) diff --git a/wagtail/tests/models.py b/wagtail/tests/models.py index a38d889bd..27a89b307 100644 --- a/wagtail/tests/models.py +++ b/wagtail/tests/models.py @@ -17,7 +17,7 @@ from wagtail.wagtailimages.edit_handlers import ImageChooserPanel from wagtail.wagtaildocs.edit_handlers import DocumentChooserPanel from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField from wagtail.wagtailsnippets.models import register_snippet -from wagtail.wagtailsearch import indexed +from wagtail.wagtailsearch import index from wagtail.contrib.wagtailroutablepage.models import RoutablePage @@ -387,19 +387,19 @@ class BusinessChild(Page): subpage_types = [] -class SearchTest(models.Model, indexed.Indexed): +class SearchTest(models.Model, index.Indexed): title = models.CharField(max_length=255) content = models.TextField() live = models.BooleanField(default=False) published_date = models.DateField(null=True) search_fields = [ - indexed.SearchField('title', partial_match=True), - indexed.SearchField('content'), - indexed.SearchField('callable_indexed_field'), - indexed.FilterField('title'), - indexed.FilterField('live'), - indexed.FilterField('published_date'), + index.SearchField('title', partial_match=True), + index.SearchField('content'), + index.SearchField('callable_indexed_field'), + index.FilterField('title'), + index.FilterField('live'), + index.FilterField('published_date'), ] def callable_indexed_field(self): @@ -411,12 +411,12 @@ class SearchTestChild(SearchTest): extra_content = models.TextField() search_fields = SearchTest.search_fields + [ - indexed.SearchField('subtitle', partial_match=True), - indexed.SearchField('extra_content'), + index.SearchField('subtitle', partial_match=True), + index.SearchField('extra_content'), ] -class SearchTestOldConfig(models.Model, indexed.Indexed): +class SearchTestOldConfig(models.Model, index.Indexed): """ This tests that the Indexed class can correctly handle models that use the old "indexed_fields" configuration format. @@ -437,7 +437,7 @@ class SearchTestOldConfig(models.Model, indexed.Indexed): } -class SearchTestOldConfigList(models.Model, indexed.Indexed): +class SearchTestOldConfigList(models.Model, index.Indexed): """ This tests that the Indexed class can correctly handle models that use the old "indexed_fields" configuration format using a list. diff --git a/wagtail/utils/deprecation.py b/wagtail/utils/deprecation.py index 24dc4e589..4a5fb9382 100644 --- a/wagtail/utils/deprecation.py +++ b/wagtail/utils/deprecation.py @@ -4,3 +4,7 @@ class RemovedInWagtail06Warning(DeprecationWarning): class RemovedInWagtail07Warning(PendingDeprecationWarning): pass + + +class RemovedInWagtail08Warning(PendingDeprecationWarning): + pass diff --git a/wagtail/wagtailadmin/taggable.py b/wagtail/wagtailadmin/taggable.py index 3b7de479c..ce8698231 100644 --- a/wagtail/wagtailadmin/taggable.py +++ b/wagtail/wagtailadmin/taggable.py @@ -4,19 +4,19 @@ from django.contrib.contenttypes.models import ContentType from django.db.models import Count from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger -from wagtail.wagtailsearch import indexed +from wagtail.wagtailsearch import index from wagtail.wagtailsearch.backends import get_search_backend -class TagSearchable(indexed.Indexed): +class TagSearchable(index.Indexed): """ Mixin to provide a 'search' method, searching on the 'title' field and tags, for models that provide those things. """ search_fields = ( - indexed.SearchField('title', partial_match=True, boost=10), - indexed.SearchField('get_tags', partial_match=True, boost=10) + index.SearchField('title', partial_match=True, boost=10), + index.SearchField('get_tags', partial_match=True, boost=10) ) @property diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index a237e16e6..2919b809c 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -32,7 +32,7 @@ from wagtail.wagtailcore.utils import camelcase_to_underscore from wagtail.wagtailcore.query import PageQuerySet from wagtail.wagtailcore.url_routing import RouteResult -from wagtail.wagtailsearch import indexed +from wagtail.wagtailsearch import index from wagtail.wagtailsearch.backends import get_search_backend @@ -274,7 +274,7 @@ class PageBase(models.base.ModelBase): @python_2_unicode_compatible -class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Indexed)): +class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed)): title = models.CharField(max_length=255, help_text=_("The page title as you'd like it to be seen by the public")) slug = models.SlugField(help_text=_("The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/")) # TODO: enforce uniqueness on slug field per parent (will have to be done at the Django @@ -294,13 +294,13 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index expired = models.BooleanField(default=False, editable=False) search_fields = ( - indexed.SearchField('title', partial_match=True, boost=100), - indexed.FilterField('id'), - indexed.FilterField('live'), - indexed.FilterField('owner'), - indexed.FilterField('content_type'), - indexed.FilterField('path'), - indexed.FilterField('depth'), + index.SearchField('title', partial_match=True, boost=100), + index.FilterField('id'), + index.FilterField('live'), + index.FilterField('owner'), + index.FilterField('content_type'), + index.FilterField('path'), + index.FilterField('depth'), ) def __init__(self, *args, **kwargs): diff --git a/wagtail/wagtaildocs/models.py b/wagtail/wagtaildocs/models.py index f930a493c..5f9b374f2 100644 --- a/wagtail/wagtaildocs/models.py +++ b/wagtail/wagtaildocs/models.py @@ -13,7 +13,7 @@ from django.utils.encoding import python_2_unicode_compatible from wagtail.wagtailadmin.taggable import TagSearchable from wagtail.wagtailadmin.utils import get_object_usage -from wagtail.wagtailsearch import indexed +from wagtail.wagtailsearch import index @python_2_unicode_compatible @@ -26,7 +26,7 @@ class Document(models.Model, TagSearchable): tags = TaggableManager(help_text=None, blank=True, verbose_name=_('Tags')) search_fields = TagSearchable.search_fields + ( - indexed.FilterField('uploaded_by_user'), + index.FilterField('uploaded_by_user'), ) def __str__(self): diff --git a/wagtail/wagtailimages/models.py b/wagtail/wagtailimages/models.py index b29d50e0c..63151b602 100644 --- a/wagtail/wagtailimages/models.py +++ b/wagtail/wagtailimages/models.py @@ -22,7 +22,7 @@ from unidecode import unidecode from wagtail.wagtailadmin.taggable import TagSearchable from wagtail.wagtailimages.backends import get_image_backend -from wagtail.wagtailsearch import indexed +from wagtail.wagtailsearch import index from wagtail.wagtailimages.utils.validators import validate_image_format from wagtail.wagtailimages.utils.focal_point import FocalPoint from wagtail.wagtailimages.utils.feature_detection import FeatureDetector, opencv_available @@ -68,7 +68,7 @@ class AbstractImage(models.Model, TagSearchable): args=(self.id,)) search_fields = TagSearchable.search_fields + ( - indexed.FilterField('uploaded_by_user'), + index.FilterField('uploaded_by_user'), ) def __str__(self): diff --git a/wagtail/wagtailsearch/__init__.py b/wagtail/wagtailsearch/__init__.py index ed896f445..71cc69f06 100644 --- a/wagtail/wagtailsearch/__init__.py +++ b/wagtail/wagtailsearch/__init__.py @@ -1,3 +1,3 @@ -from wagtail.wagtailsearch.indexed import Indexed +from wagtail.wagtailsearch.index import Indexed from wagtail.wagtailsearch.signal_handlers import register_signal_handlers from wagtail.wagtailsearch.backends import get_search_backend \ No newline at end of file diff --git a/wagtail/wagtailsearch/backends/base.py b/wagtail/wagtailsearch/backends/base.py index 82e2e8d56..1928a7bbe 100644 --- a/wagtail/wagtailsearch/backends/base.py +++ b/wagtail/wagtailsearch/backends/base.py @@ -2,7 +2,7 @@ from django.db import models from django.db.models.query import QuerySet from django.core.exceptions import ImproperlyConfigured -from wagtail.wagtailsearch.indexed import Indexed +from wagtail.wagtailsearch.index import Indexed from wagtail.wagtailsearch.utils import normalise_query_string diff --git a/wagtail/wagtailsearch/backends/db.py b/wagtail/wagtailsearch/backends/db.py index a94fe3c58..3f7e64f42 100644 --- a/wagtail/wagtailsearch/backends/db.py +++ b/wagtail/wagtailsearch/backends/db.py @@ -1,7 +1,6 @@ from django.db import models from wagtail.wagtailsearch.backends.base import BaseSearch -from wagtail.wagtailsearch.indexed import Indexed class DBSearch(BaseSearch): diff --git a/wagtail/wagtailsearch/backends/elasticsearch.py b/wagtail/wagtailsearch/backends/elasticsearch.py index 8f8a78dbb..9e82fe66a 100644 --- a/wagtail/wagtailsearch/backends/elasticsearch.py +++ b/wagtail/wagtailsearch/backends/elasticsearch.py @@ -11,7 +11,7 @@ from elasticsearch import Elasticsearch, NotFoundError, RequestError from elasticsearch.helpers import bulk from wagtail.wagtailsearch.backends.base import BaseSearch -from wagtail.wagtailsearch.indexed import Indexed, SearchField, FilterField +from wagtail.wagtailsearch.index import Indexed, SearchField, FilterField class ElasticSearchMapping(object): diff --git a/wagtail/wagtailsearch/indexed.py b/wagtail/wagtailsearch/indexed.py index 2828d5e3c..4ff8e7ba0 100644 --- a/wagtail/wagtailsearch/indexed.py +++ b/wagtail/wagtailsearch/indexed.py @@ -7,4 +7,5 @@ warnings.warn( "The wagtail.wagtailsearch.indexed module has been renamed. " "Use wagtail.wagtailsearch.index instead.", RemovedInWagtail08Warning) + from .index import * diff --git a/wagtail/wagtailsearch/models.py b/wagtail/wagtailsearch/models.py index f82bb2462..a24183ad9 100644 --- a/wagtail/wagtailsearch/models.py +++ b/wagtail/wagtailsearch/models.py @@ -4,7 +4,6 @@ from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible -from wagtail.wagtailsearch import indexed from wagtail.wagtailsearch.utils import normalise_query_string, MAX_QUERY_STRING_LENGTH diff --git a/wagtail/wagtailsearch/signal_handlers.py b/wagtail/wagtailsearch/signal_handlers.py index 3550e5175..1c55eb59f 100644 --- a/wagtail/wagtailsearch/signal_handlers.py +++ b/wagtail/wagtailsearch/signal_handlers.py @@ -2,7 +2,7 @@ from django.db.models.signals import post_save, post_delete from django.db import models from django.conf import settings -from wagtail.wagtailsearch.indexed import Indexed +from wagtail.wagtailsearch.index import Indexed from wagtail.wagtailsearch.backends import get_search_backend diff --git a/wagtail/wagtailsearch/tests/test_indexed_class.py b/wagtail/wagtailsearch/tests/test_indexed_class.py index 983d8e0ba..54eb2f161 100644 --- a/wagtail/wagtailsearch/tests/test_indexed_class.py +++ b/wagtail/wagtailsearch/tests/test_indexed_class.py @@ -2,7 +2,7 @@ import warnings from django.test import TestCase -from wagtail.wagtailsearch import indexed +from wagtail.wagtailsearch import index from wagtail.tests import models from wagtail.tests.utils import WagtailTestUtils @@ -30,12 +30,12 @@ class TestIndexedFieldsBackwardsCompatibility(TestCase, WagtailTestUtils): # Check that the fields were found self.assertEqual(len(search_fields_dict), 2) - self.assertIn(('title', indexed.SearchField), search_fields_dict.keys()) - self.assertIn(('live', indexed.FilterField), search_fields_dict.keys()) + self.assertIn(('title', index.SearchField), search_fields_dict.keys()) + self.assertIn(('live', index.FilterField), search_fields_dict.keys()) # Check that the title field has the correct settings - self.assertTrue(search_fields_dict[('title', indexed.SearchField)].partial_match) - self.assertEqual(search_fields_dict[('title', indexed.SearchField)].boost, 100) + self.assertTrue(search_fields_dict[('title', index.SearchField)].partial_match) + self.assertEqual(search_fields_dict[('title', index.SearchField)].boost, 100) def test_indexed_fields_backwards_compatibility_list(self): # Get search fields @@ -49,5 +49,5 @@ class TestIndexedFieldsBackwardsCompatibility(TestCase, WagtailTestUtils): # Check that the fields were found self.assertEqual(len(search_fields_dict), 2) - self.assertIn(('title', indexed.SearchField), search_fields_dict.keys()) - self.assertIn(('content', indexed.SearchField), search_fields_dict.keys()) + self.assertIn(('title', index.SearchField), search_fields_dict.keys()) + self.assertIn(('content', index.SearchField), search_fields_dict.keys()) From 628f94519c27197923e4f7fc0608048c5829a123 Mon Sep 17 00:00:00 2001 From: Dave Cranwell Date: Thu, 21 Aug 2014 15:17:14 +0100 Subject: [PATCH 37/66] added more Page model information about previouslly missing attributes like subpage_types --- docs/core_components/index.rst | 1 + docs/core_components/pages/creating_pages.rst | 90 ++++++++++--------- docs/core_components/pages/editing_api.rst | 1 + docs/core_components/pages/theory.rst | 2 + docs/core_components/sites.rst | 10 +++ 5 files changed, 63 insertions(+), 41 deletions(-) create mode 100644 docs/core_components/sites.rst diff --git a/docs/core_components/index.rst b/docs/core_components/index.rst index cfa67d366..a28ddf1b7 100644 --- a/docs/core_components/index.rst +++ b/docs/core_components/index.rst @@ -4,6 +4,7 @@ Core components .. toctree:: :maxdepth: 2 + sites pages/index images/index snippets diff --git a/docs/core_components/pages/creating_pages.rst b/docs/core_components/pages/creating_pages.rst index 7806274fa..fe1f7f853 100644 --- a/docs/core_components/pages/creating_pages.rst +++ b/docs/core_components/pages/creating_pages.rst @@ -2,40 +2,15 @@ Creating page models ==================== +Wagtail provides a ``Page`` class to represent types of page (a.k.a Content types). Developers should subclass ``Page`` for their own page models. -The Page Class -~~~~~~~~~~~~~~ - -``Page`` uses Django's model interface, so you can include any field type and field options that Django allows. Wagtail provides some fields and editing handlers that simplify data entry in the Wagtail admin interface, so you may want to keep those in mind when deciding what properties to add to your models in addition to those already provided by ``Page``. +``Page`` uses Django's model interface, so you can include any field type and field options that Django allows. Wagtail provides some field types of its own which simplify data entry in the Wagtail admin interface. Wagtail also wraps Django's field types and widgets with its own concept of "Edit Handlers" and "Panels". These further improve the data entry experience. -Built-in Properties of the Page Class -------------------------------------- +An example Wagtail Page Model +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Wagtail provides some properties in the ``Page`` class which are common to most webpages. Since you'll be subclassing ``Page``, you don't have to worry about implementing them. - -Public Properties -````````````````` - - ``title`` (string, required) - Human-readable title for the content - - ``slug`` (string, required) - Machine-readable URL component for this piece of content. The name of the page as it will appear in URLs e.g ``http://domain.com/blog/[my-slug]/`` - - ``seo_title`` (string) - Alternate SEO-crafted title which overrides the normal title for use in the ```` of a page - - ``search_description`` (string) - A SEO-crafted description of the content, used in both internal search indexing and for the meta description read by search engines - -The ``Page`` class actually has alot more to it, but these are probably the only built-in properties you'll need to worry about when creating templates for your models. - - -Anatomy of a Wagtail Model -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -So what does a Wagtail model definition look like? Here's a model representing a typical blog post: +This example represents a typical blog post: .. code-block:: python @@ -72,17 +47,48 @@ So what does a Wagtail model definition look like? Here's a model representing a ImageChooserPanel('feed_image'), ] -To keep track of your ``Page``-derived models, it might be helpful to include "Page" as the last part of your class name. ``BlogPage`` defines three properties: ``body``, ``date``, and ``feed_image``. These are a mix of basic Django models (``DateField``), Wagtail fields (``RichTextField``), and a pointer to a Wagtail model (``Image``). +.. tip:: + To keep track of ``Page`` models and avoid class name clashes, it can be helpful to suffix model class names with "Page" e.g BlogPage, ListingIndexPage. -Next, the ``content_panels`` and ``promote_panels`` lists define the capabilities and layout of the Wagtail admin page edit interface. The lists are filled with "panels" and "choosers", which will provide a fine-grain interface for inputting the model's content. The ``ImageChooserPanel``, for instance, lets one browse the image library, upload new images, and input image metadata. The ``RichTextField`` is the basic field for creating web-ready website rich text, including text formatting and embedded media like images and video. The Wagtail admin offers other choices for fields, Panels, and Choosers, with the option of creating your own to precisely fit your content without workarounds or other compromises. +In the example above the ``BlogPage`` class defines three properties: ``body``, ``date``, and ``feed_image``. These are a mix of basic Django models (``DateField``), Wagtail fields (``RichTextField``), and a pointer to a Wagtail model (``Image``). + +Below that the ``content_panels`` and ``promote_panels`` lists define the capabilities and layout of the page editing interface in the Wagtail admin. The lists are filled with "panels" and "choosers", which will provide a fine-grain interface for inputting the model's content. The ``ImageChooserPanel``, for instance, lets one browse the image library, upload new images and input image metadata. The ``RichTextField`` is the basic field for creating web-ready website rich text, including text formatting and embedded media like images and video. The Wagtail admin offers other choices for fields, Panels, and Choosers, with the option of creating your own to precisely fit your content without workarounds or other compromises. Your models may be even more complex, with methods overriding the built-in functionality of the ``Page`` to achieve webdev magic. Or, you can keep your models simple and let Wagtail's built-in functionality do the work. -Now that we have a basic idea of how our content is defined, lets look at relationships between pieces of content. + +``Page`` Class Reference +~~~~~~~~~~~~~~~~~~~~~~~~ + +Default fields +-------------- + +Wagtail provides some fields for the ``Page`` class by default, which will be common to all your pages. You don't need to add these fields to your own page models however you do need to allocate them to ``content_panels``, ``promote_panels`` or ``settings_panels``. See above example and for further information on the panels see :ref:`editing-api`. + + ``title`` (string, required) + Human-readable title of the page - what you'd probably use as your ``

    `` tag. + + ``slug`` (string, required) + Machine-readable URL component for this page. The name of the page as it will appear in URLs e.g ``http://domain.com/blog/[my-slug]/`` + + ``seo_title`` (string) + Alternate SEO-crafted title, mainly for use in the page ```` tag. + + ``search_description`` (string) + SEO-crafted description of the content, used for internal search indexing, suitable for your page's ``<meta name="description">`` tag. + + ``show_in_menus`` (boolean) + Toggles whether the page should be considered for inclusion in any site-wide menus you create. + + ``go_live_at`` (datetime) + A datetime on which the page should be automatically made published (made publicly accessible) + + ``expire_at`` (datetime) + A datetime on which the page should be unpublished, rendering it inaccessible to the public. -Page Properties and Methods Reference -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Page Attributes, Properties and Methods Reference +------------------------------------------------- In addition to the model fields provided, ``Page`` has many properties and methods that you may wish to reference, use, or override in creating your own models. Those listed here are relatively straightforward to use, but consult the Wagtail source code for a full view of what's possible. @@ -121,14 +127,16 @@ In addition to the model fields provided, ``Page`` has many properties and metho .. automethod:: search + .. attribute:: search_fields + + A list of fields to be indexed by the search engine. See Search docs :ref:`wagtailsearch_for_python_developers` -.. _wagtail_site_admin: + .. attribute:: subpage_types -Site -~~~~ + A whitelist of page models which can be created as children of this page type e.g a ``BlogIndex`` page might allow ``BlogPage``, but not ``JobPage``. -Django's built-in admin interface provides the way to map a "site" (hostname or domain) to any node in the wagtail tree, using that node as the site's root. + .. attribute:: password_required_template + + Defines which template file should be used to render the login form for Protected pages using this model. This overrides the default, defined using ``PASSWORD_REQUIRED_TEMPLATE`` in your settings. See :ref:`private_pages` -Access this by going to ``/django-admin/`` and then "Home › Wagtailcore › Sites." To try out a development site, add a single site with the hostname ``localhost`` at port ``8000`` and map it to one of the pieces of content you have created. -Wagtail's developers plan to move the site settings into the Wagtail admin interface. diff --git a/docs/core_components/pages/editing_api.rst b/docs/core_components/pages/editing_api.rst index 4d346a815..f1025cbcb 100644 --- a/docs/core_components/pages/editing_api.rst +++ b/docs/core_components/pages/editing_api.rst @@ -1,3 +1,4 @@ +.. _editing-api: Defining models with the Editing API ==================================== diff --git a/docs/core_components/pages/theory.rst b/docs/core_components/pages/theory.rst index 272ca3d1d..bcea079bb 100644 --- a/docs/core_components/pages/theory.rst +++ b/docs/core_components/pages/theory.rst @@ -1,3 +1,5 @@ +.. _pages-theory: + ====== Theory ====== diff --git a/docs/core_components/sites.rst b/docs/core_components/sites.rst new file mode 100644 index 000000000..89c490b65 --- /dev/null +++ b/docs/core_components/sites.rst @@ -0,0 +1,10 @@ +.. _wagtail_site_admin: + +Sites +===== + +Django's built-in admin interface provides the way to map a "site" (hostname or domain) to any node in the wagtail tree, using that node as the site's root. See :ref:`pages-theory`. + +Access this by going to ``/django-admin/`` and then "Home › Wagtailcore › Sites." To try out a development site, add a single site with the hostname ``localhost`` at port ``8000`` and map it to one of the pieces of content you have created. + +Wagtail's developers plan to move the site settings into the Wagtail admin interface. From 6eb5f821ed4e808329c37f78a3acdf1cf77bef57 Mon Sep 17 00:00:00 2001 From: Dave Cranwell <david@torchbox.com> Date: Thu, 21 Aug 2014 15:56:55 +0100 Subject: [PATCH 38/66] added quick django example --- docs/core_components/pages/creating_pages.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/core_components/pages/creating_pages.rst b/docs/core_components/pages/creating_pages.rst index fe1f7f853..e6fb9a14b 100644 --- a/docs/core_components/pages/creating_pages.rst +++ b/docs/core_components/pages/creating_pages.rst @@ -33,6 +33,8 @@ This example represents a typical blog post: related_name='+' ) + + BlogPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('date'), @@ -133,7 +135,12 @@ In addition to the model fields provided, ``Page`` has many properties and metho .. attribute:: subpage_types - A whitelist of page models which can be created as children of this page type e.g a ``BlogIndex`` page might allow ``BlogPage``, but not ``JobPage``. + A whitelist of page models which can be created as children of this page type e.g a ``BlogIndex`` page might allow ``BlogPage``, but not ``JobPage`` e.g + + .. code-block:: python + + class BlogIndex(Page): + subpage_types = ['mysite.BlogPage', 'mysite.BlogArchivePage'] .. attribute:: password_required_template From f5c57607ed4bcb30e124bc3309f1bfa83a0808ef Mon Sep 17 00:00:00 2001 From: Dave Cranwell <david@torchbox.com> Date: Fri, 22 Aug 2014 11:28:05 +0100 Subject: [PATCH 39/66] added progress indicator to styleguide --- .../templates/wagtailstyleguide/base.html | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html b/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html index bca7ce8a1..667798c80 100644 --- a/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html +++ b/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html @@ -30,6 +30,7 @@ <li><a href="#editor">Page editor</a></li> <li><a href="#tabs">Tabs</a></li> <li><a href="#breadcrumbs">Breadcrumbs</a></li> + <li><a href="#progress">Progress indicators</a></li> <li><a href="#misc">Misc formatters</a></li> <li><a href="#icons">Icons</a></li> </ul> @@ -406,6 +407,20 @@ </section> + <section id="progress"> + <h2>Progress indicators</h2> + + <div id="progress-example" class="progress active"> + <div class="bar">60%</div> + </div> + + <p> </p> + + <div id="progress-example2" class="progress active"> + <div class="bar" style="width: 50%;">50%</div> + </div> + </section> + <section id="misc"> <h2>Misc formatters</h2> <h3>Avatar icons</h3> @@ -506,7 +521,16 @@ {% block extra_js %} <script> $(function(){ - + (function runprogress(){ + var to = setTimeout(function(){ + runprogress(); + clearTimeout(to); + var to2 = setTimeout(function(){ + $('#progress-example .bar').css('width', '20%'); + }, 2000); + }, 3000); + $('#progress-example .bar').css('width', '80%'); + })(); }) </script> {% endblock %} \ No newline at end of file From f45795ef4c687245a5615fbdd35bdbc1eb6debcf Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Tue, 26 Aug 2014 12:13:08 +0100 Subject: [PATCH 40/66] Changelog and release notes for #562 --- CHANGELOG.txt | 1 + docs/releases/0.6.rst | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 803ad742d..14b1bcd1f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changelog ~~~~~~~~~~~~~~~~ * Added {% routablepageurl %} template tag (@timheap) * Added RoutablePageMixin (@timheap) + * Renamed wagtailsearch.indexed to wagtailsearch.index * Fix: Page URL generation now returns correct URLs for sites that have the main 'serve' view rooted somewhere other than '/' 0.5 (01.08.2014) diff --git a/docs/releases/0.6.rst b/docs/releases/0.6.rst index 321c43730..aa0b29960 100644 --- a/docs/releases/0.6.rst +++ b/docs/releases/0.6.rst @@ -22,3 +22,10 @@ Bug fixes Upgrade considerations ====================== + + +Deprecated features +=================== + + * The ``wagtail.wagtailsearch.indexed`` module has been renamed to ``wagtail.wagtailsearch.index`` + \ No newline at end of file From 09086b13b2c9835d52d75884da2be5c4ec311849 Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Tue, 26 Aug 2014 12:14:39 +0100 Subject: [PATCH 41/66] Docs changes for #562 --- .../search/for_python_developers.rst | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/core_components/search/for_python_developers.rst b/docs/core_components/search/for_python_developers.rst index b99795e7b..5b572ec3e 100644 --- a/docs/core_components/search/for_python_developers.rst +++ b/docs/core_components/search/for_python_developers.rst @@ -56,15 +56,15 @@ This creates an ``EventPage`` model with two fields ``description`` and ``date`` .. code-block:: python - from wagtail.wagtailsearch import indexed + from wagtail.wagtailsearch import index class EventPage(Page): description = models.TextField() date = models.DateField() search_fields = Page.search_fields + ( # Inherit search_fields from Page - indexed.SearchField('description'), - indexed.FilterField('date'), + index.SearchField('description'), + index.FilterField('date'), ) @@ -72,7 +72,7 @@ This creates an ``EventPage`` model with two fields ``description`` and ``date`` >>> EventPage.objects.filter(date__gt=timezone.now()).search("Christmas") -``indexed.SearchField`` +``index.SearchField`` ----------------------- These are added to the search index and are used for performing full-text searches on your models. These would usually be text fields. @@ -86,7 +86,7 @@ Options - **es_extra** (dict) - This field is to allow the developer to set or override any setting on the field in the ElasticSearch mapping. Use this if you want to make use of any ElasticSearch features that are not yet supported in Wagtail. -``indexed.FilterField`` +``index.FilterField`` ----------------------- These are added to the search index but are not used for full-text searches. Instead, they allow you to run filters on your search results. @@ -107,7 +107,7 @@ One use for this is indexing ``get_*_display`` methods Django creates automatica .. code-block:: python - from wagtail.wagtailsearch import indexed + from wagtail.wagtailsearch import index class EventPage(Page): IS_PRIVATE_CHOICES = ( @@ -119,10 +119,10 @@ One use for this is indexing ``get_*_display`` methods Django creates automatica search_fields = Page.search_fields + ( # Index the human-readable string for searching - indexed.SearchField('get_is_private_display'), + index.SearchField('get_is_private_display'), # Index the boolean value for filtering - indexed.FilterField('is_private'), + index.FilterField('is_private'), ) @@ -131,25 +131,25 @@ Indexing non-page models Any Django model can be indexed and searched. -To do this, inherit from ``indexed.Indexed`` and add some ``search_fields`` to the model. +To do this, inherit from ``index.Indexed`` and add some ``search_fields`` to the model. .. code-block:: python - from wagtail.wagtailsearch import indexed + from wagtail.wagtailsearch import index - class Book(models.Model, indexed.Indexed): + class Book(models.Model, index.Indexed): title = models.CharField(max_length=255) genre = models.CharField(max_length=255, choices=GENRE_CHOICES) author = models.ForeignKey(Author) published_date = models.DateTimeField() search_fields = ( - indexed.SearchField('title', partial_match=True, boost=10), - indexed.SearchField('get_genre_display'), + index.SearchField('title', partial_match=True, boost=10), + index.SearchField('get_genre_display'), - indexed.FilterField('genre'), - indexed.FilterField('author'), - indexed.FilterField('published_date'), + index.FilterField('genre'), + index.FilterField('author'), + index.FilterField('published_date'), ) # As this model doesn't have a search method in its QuerySet, we have to call search directly on the backend From 053a75ef9daabe92b4ca74d99e1fdda15f1363a3 Mon Sep 17 00:00:00 2001 From: Dave Cranwell <davecranwell@users.noreply.github.com> Date: Tue, 26 Aug 2014 13:26:56 +0100 Subject: [PATCH 42/66] clarify ElasticSearch dependency --- docs/core_components/search/for_python_developers.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core_components/search/for_python_developers.rst b/docs/core_components/search/for_python_developers.rst index 5b572ec3e..784da92fc 100644 --- a/docs/core_components/search/for_python_developers.rst +++ b/docs/core_components/search/for_python_developers.rst @@ -36,9 +36,9 @@ Indexing extra fields The ``indexed_fields`` configuration format was replaced with ``search_fields`` -.. note:: +.. warning:: - Searching on extra fields with the database backend is not currently supported. + Searching on extra fields by overriding ``search_fields`` is only supported with ElasticSearch. If you're using the database backend, any other fields you define via ``search_fields`` will be ignored. Fields need to be explicitly added to the search configuration in order for you to be able to search/filter on them. From 15ba294bcd5e409cca380901c015d56a4e065d33 Mon Sep 17 00:00:00 2001 From: Dave Cranwell <davecranwell@users.noreply.github.com> Date: Tue, 26 Aug 2014 13:40:37 +0100 Subject: [PATCH 43/66] index -> indexed, plus other tweaks --- .../search/for_python_developers.rst | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/docs/core_components/search/for_python_developers.rst b/docs/core_components/search/for_python_developers.rst index 784da92fc..af7c49af7 100644 --- a/docs/core_components/search/for_python_developers.rst +++ b/docs/core_components/search/for_python_developers.rst @@ -10,6 +10,8 @@ For Python developers Basic usage =========== +By default using the database backend, Wagtail's search will only index the ``title`` field of pages. + All searches are performed on Django QuerySets. Wagtail provides a ``search`` method on the queryset for all page models: .. code-block:: python @@ -38,17 +40,13 @@ Indexing extra fields .. warning:: - Searching on extra fields by overriding ``search_fields`` is only supported with ElasticSearch. If you're using the database backend, any other fields you define via ``search_fields`` will be ignored. + Indexing extra fields is only supported with ElasticSearch as your backend. If you're using the database backend, any other fields you define via ``search_fields`` will be ignored. -Fields need to be explicitly added to the search configuration in order for you to be able to search/filter on them. - -You can add new fields to the search index by overriding the ``search_fields`` property and appending a list of extra ``SearchField``/``FilterField`` objects to it. - -The default value of ``search_fields`` (as set in ``Page``) indexes the ``title`` field as a ``SearchField`` and some other generally useful fields as ``FilterField`` rules. +Fields must be explicitly added to the ``search_fields`` property of your ``Page``-derived model, in order for you to be able to search/filter on them. This is done by overriding ``search_fields`` to append a list of extra ``SearchField``/``FilterField`` objects to it. -Quick example +Example ------------- This creates an ``EventPage`` model with two fields ``description`` and ``date``. ``description`` is indexed as a ``SearchField`` and ``date`` is indexed as a ``FilterField`` @@ -56,15 +54,15 @@ This creates an ``EventPage`` model with two fields ``description`` and ``date`` .. code-block:: python - from wagtail.wagtailsearch import index + from wagtail.wagtailsearch import indexed class EventPage(Page): description = models.TextField() date = models.DateField() search_fields = Page.search_fields + ( # Inherit search_fields from Page - index.SearchField('description'), - index.FilterField('date'), + indexed.SearchField('description'), + indexed.FilterField('date'), ) @@ -72,7 +70,7 @@ This creates an ``EventPage`` model with two fields ``description`` and ``date`` >>> EventPage.objects.filter(date__gt=timezone.now()).search("Christmas") -``index.SearchField`` +``indexed.SearchField`` ----------------------- These are added to the search index and are used for performing full-text searches on your models. These would usually be text fields. @@ -86,7 +84,7 @@ Options - **es_extra** (dict) - This field is to allow the developer to set or override any setting on the field in the ElasticSearch mapping. Use this if you want to make use of any ElasticSearch features that are not yet supported in Wagtail. -``index.FilterField`` +``indexed.FilterField`` ----------------------- These are added to the search index but are not used for full-text searches. Instead, they allow you to run filters on your search results. @@ -107,7 +105,7 @@ One use for this is indexing ``get_*_display`` methods Django creates automatica .. code-block:: python - from wagtail.wagtailsearch import index + from wagtail.wagtailsearch import indexed class EventPage(Page): IS_PRIVATE_CHOICES = ( @@ -119,10 +117,10 @@ One use for this is indexing ``get_*_display`` methods Django creates automatica search_fields = Page.search_fields + ( # Index the human-readable string for searching - index.SearchField('get_is_private_display'), + indexed.SearchField('get_is_private_display'), # Index the boolean value for filtering - index.FilterField('is_private'), + indexed.FilterField('is_private'), ) @@ -135,7 +133,7 @@ To do this, inherit from ``index.Indexed`` and add some ``search_fields`` to the .. code-block:: python - from wagtail.wagtailsearch import index + from wagtail.wagtailsearch import indexed class Book(models.Model, index.Indexed): title = models.CharField(max_length=255) @@ -144,12 +142,12 @@ To do this, inherit from ``index.Indexed`` and add some ``search_fields`` to the published_date = models.DateTimeField() search_fields = ( - index.SearchField('title', partial_match=True, boost=10), - index.SearchField('get_genre_display'), + indexed.SearchField('title', partial_match=True, boost=10), + indexed.SearchField('get_genre_display'), - index.FilterField('genre'), - index.FilterField('author'), - index.FilterField('published_date'), + indexed.FilterField('genre'), + indexed.FilterField('author'), + indexed.FilterField('published_date'), ) # As this model doesn't have a search method in its QuerySet, we have to call search directly on the backend From 504732433bbf365d3ba6b9eae2b56e388c37f6b3 Mon Sep 17 00:00:00 2001 From: Dave Cranwell <davecranwell@users.noreply.github.com> Date: Tue, 26 Aug 2014 13:41:02 +0100 Subject: [PATCH 44/66] Update for_python_developers.rst --- docs/core_components/search/for_python_developers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core_components/search/for_python_developers.rst b/docs/core_components/search/for_python_developers.rst index af7c49af7..27a39b4aa 100644 --- a/docs/core_components/search/for_python_developers.rst +++ b/docs/core_components/search/for_python_developers.rst @@ -10,7 +10,7 @@ For Python developers Basic usage =========== -By default using the database backend, Wagtail's search will only index the ``title`` field of pages. +By default using the :ref:`wagtailsearch_backends_database`, Wagtail's search will only index the ``title`` field of pages. All searches are performed on Django QuerySets. Wagtail provides a ``search`` method on the queryset for all page models: From b9c6a0a8024d27ffdb6794570fb81f007d659c1b Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Tue, 26 Aug 2014 16:03:59 +0100 Subject: [PATCH 45/66] Renamed indexed to index --- .../search/for_python_developers.rst | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/core_components/search/for_python_developers.rst b/docs/core_components/search/for_python_developers.rst index 27a39b4aa..eecd5646a 100644 --- a/docs/core_components/search/for_python_developers.rst +++ b/docs/core_components/search/for_python_developers.rst @@ -54,15 +54,15 @@ This creates an ``EventPage`` model with two fields ``description`` and ``date`` .. code-block:: python - from wagtail.wagtailsearch import indexed + from wagtail.wagtailsearch import index class EventPage(Page): description = models.TextField() date = models.DateField() search_fields = Page.search_fields + ( # Inherit search_fields from Page - indexed.SearchField('description'), - indexed.FilterField('date'), + index.SearchField('description'), + index.FilterField('date'), ) @@ -70,7 +70,7 @@ This creates an ``EventPage`` model with two fields ``description`` and ``date`` >>> EventPage.objects.filter(date__gt=timezone.now()).search("Christmas") -``indexed.SearchField`` +``index.SearchField`` ----------------------- These are added to the search index and are used for performing full-text searches on your models. These would usually be text fields. @@ -84,7 +84,7 @@ Options - **es_extra** (dict) - This field is to allow the developer to set or override any setting on the field in the ElasticSearch mapping. Use this if you want to make use of any ElasticSearch features that are not yet supported in Wagtail. -``indexed.FilterField`` +``index.FilterField`` ----------------------- These are added to the search index but are not used for full-text searches. Instead, they allow you to run filters on your search results. @@ -105,7 +105,7 @@ One use for this is indexing ``get_*_display`` methods Django creates automatica .. code-block:: python - from wagtail.wagtailsearch import indexed + from wagtail.wagtailsearch import index class EventPage(Page): IS_PRIVATE_CHOICES = ( @@ -117,10 +117,10 @@ One use for this is indexing ``get_*_display`` methods Django creates automatica search_fields = Page.search_fields + ( # Index the human-readable string for searching - indexed.SearchField('get_is_private_display'), + index.SearchField('get_is_private_display'), # Index the boolean value for filtering - indexed.FilterField('is_private'), + index.FilterField('is_private'), ) @@ -133,7 +133,7 @@ To do this, inherit from ``index.Indexed`` and add some ``search_fields`` to the .. code-block:: python - from wagtail.wagtailsearch import indexed + from wagtail.wagtailsearch import index class Book(models.Model, index.Indexed): title = models.CharField(max_length=255) @@ -142,12 +142,12 @@ To do this, inherit from ``index.Indexed`` and add some ``search_fields`` to the published_date = models.DateTimeField() search_fields = ( - indexed.SearchField('title', partial_match=True, boost=10), - indexed.SearchField('get_genre_display'), + index.SearchField('title', partial_match=True, boost=10), + index.SearchField('get_genre_display'), - indexed.FilterField('genre'), - indexed.FilterField('author'), - indexed.FilterField('published_date'), + index.FilterField('genre'), + index.FilterField('author'), + index.FilterField('published_date'), ) # As this model doesn't have a search method in its QuerySet, we have to call search directly on the backend From c300477c7723c7fee46d656b48088caafc6c74a0 Mon Sep 17 00:00:00 2001 From: Dave Cranwell <david@torchbox.com> Date: Tue, 26 Aug 2014 16:23:53 +0100 Subject: [PATCH 46/66] reinstated missing modernizr test used by edit bird --- .../static/wagtailadmin/js/vendor/modernizr-2.6.2.min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wagtail/wagtailadmin/static/wagtailadmin/js/vendor/modernizr-2.6.2.min.js b/wagtail/wagtailadmin/static/wagtailadmin/js/vendor/modernizr-2.6.2.min.js index 7eb2abe75..f18b5c2c9 100644 --- a/wagtail/wagtailadmin/static/wagtailadmin/js/vendor/modernizr-2.6.2.min.js +++ b/wagtail/wagtailadmin/static/wagtailadmin/js/vendor/modernizr-2.6.2.min.js @@ -1,4 +1,4 @@ /* Modernizr 2.8.3 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-cssanimations-cssreflections-csstransforms-csstransforms3d-csstransitions-draganddrop-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-file_api-load + * Build: http://modernizr.com/download/#-cssanimations-cssreflections-csstransforms-csstransforms3d-csstransitions-draganddrop-touch-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-file_api-load */ -;window.Modernizr=function(a,b,c){function B(a){j.cssText=a}function C(a,b){return B(m.join(a+";")+(b||""))}function D(a,b){return typeof a===b}function E(a,b){return!!~(""+a).indexOf(b)}function F(a,b){for(var d in a){var e=a[d];if(!E(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function G(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:D(f,"function")?f.bind(d||b):f}return!1}function H(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return D(b,"string")||D(b,"undefined")?F(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),G(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b)&&c(b).matches||!1;var d;return w("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},y=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),z={}.hasOwnProperty,A;!D(z,"undefined")&&!D(z.call,"undefined")?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},q.cssanimations=function(){return H("animationName")},q.cssreflections=function(){return H("boxReflect")},q.csstransforms=function(){return!!H("transform")},q.csstransforms3d=function(){var a=!!H("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},q.csstransitions=function(){return H("transition")};for(var I in q)A(q,I)&&(v=I.toLowerCase(),e[v]=q[I](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},B(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.mq=x,e.hasEvent=y,e.testProp=function(a){return F([a])},e.testAllProps=H,e.testStyles=w,e.prefixed=function(a,b,c){return b?H(a,b,c):H(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest("filereader",function(){return!!(window.File&&window.FileList&&window.FileReader)}); \ No newline at end of file +;window.Modernizr=function(a,b,c){function B(a){j.cssText=a}function C(a,b){return B(m.join(a+";")+(b||""))}function D(a,b){return typeof a===b}function E(a,b){return!!~(""+a).indexOf(b)}function F(a,b){for(var d in a){var e=a[d];if(!E(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function G(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:D(f,"function")?f.bind(d||b):f}return!1}function H(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return D(b,"string")||D(b,"undefined")?F(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),G(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b)&&c(b).matches||!1;var d;return w("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},y=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),z={}.hasOwnProperty,A;!D(z,"undefined")&&!D(z.call,"undefined")?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},q.cssanimations=function(){return H("animationName")},q.cssreflections=function(){return H("boxReflect")},q.csstransforms=function(){return!!H("transform")},q.csstransforms3d=function(){var a=!!H("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},q.csstransitions=function(){return H("transition")};for(var I in q)A(q,I)&&(v=I.toLowerCase(),e[v]=q[I](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},B(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.mq=x,e.hasEvent=y,e.testProp=function(a){return F([a])},e.testAllProps=H,e.testStyles=w,e.prefixed=function(a,b,c){return b?H(a,b,c):H(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest("filereader",function(){return!!(window.File&&window.FileList&&window.FileReader)}); \ No newline at end of file From c3360408bb6dbf98776770a68d6b3628a90a18e1 Mon Sep 17 00:00:00 2001 From: Dave Cranwell <david@torchbox.com> Date: Tue, 26 Aug 2014 17:11:44 +0100 Subject: [PATCH 47/66] added use of help-block. reformatted help blocks not to float, too much of a pain --- .../static/wagtailadmin/scss/components/typography.scss | 1 - .../templates/wagtailadmin/page_privacy/set_privacy.html | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/wagtail/wagtailadmin/static/wagtailadmin/scss/components/typography.scss b/wagtail/wagtailadmin/static/wagtailadmin/scss/components/typography.scss index 1b7e36324..059392aaf 100644 --- a/wagtail/wagtailadmin/static/wagtailadmin/scss/components/typography.scss +++ b/wagtail/wagtailadmin/static/wagtailadmin/scss/components/typography.scss @@ -56,7 +56,6 @@ kbd{ /* Help text formatters */ .help-block{ - float:left; padding:1em; margin:1em 0; clear:both; diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/page_privacy/set_privacy.html b/wagtail/wagtailadmin/templates/wagtailadmin/page_privacy/set_privacy.html index 6298d6f5f..263908a26 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/page_privacy/set_privacy.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/page_privacy/set_privacy.html @@ -3,7 +3,7 @@ {% include "wagtailadmin/shared/header.html" with title=title_str icon="locked" %} <div class="nice-padding"> - <p>{% trans "<b>Note:</b> privacy changes apply to all children of this page too." %}</p> + <p class="help-block help-warning">{% trans "Privacy changes apply to all children of this page too." %}</p> <form action="{% url 'wagtailadmin_pages_set_privacy' page.id %}" method="POST"> {% csrf_token %} <ul class="fields"> From 53d3afe8dfa0ad17436cf87a0af25c6cd8bc53bd Mon Sep 17 00:00:00 2001 From: Dave Cranwell <david@torchbox.com> Date: Tue, 26 Aug 2014 17:18:42 +0100 Subject: [PATCH 48/66] is_restricted -> page_types_restricted. missing space added --- .../templates/wagtailadmin/chooser/_search_results.html | 4 ++-- .../wagtailadmin/templates/wagtailadmin/chooser/browse.html | 2 +- wagtail/wagtailadmin/views/chooser.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html index 7554187eb..62f911bf0 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/_search_results.html @@ -1,6 +1,6 @@ {% load i18n %} -{% if is_restricted %} +{% if page_types_restricted %} <p class="help-block help-warning"> {% blocktrans with type=page_type.get_verbose_name %} Only pages of type "{{ type }}" may be chosen for this field. Search results will exclude pages of other types. @@ -22,7 +22,7 @@ {% endif %} {% if pages %} - {% if is_searching%} + {% if is_searching %} {% include "wagtailadmin/pages/list.html" with choosing=1 show_parent=1 pages=pages parent_page=parent_page %} {% else %} {% include "wagtailadmin/pages/list.html" with choosing=1 allow_navigation=1 orderable=0 pages=pages parent_page=parent_page %} diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html index 50e81c0f1..98f758204 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/chooser/browse.html @@ -1,5 +1,5 @@ {% load i18n %} -{% if is_restricted %} +{% if page_types_restricted %} {% trans "Choose" as choose_str %} {% trans page_type.get_verbose_name as subtitle %} {% else %} diff --git a/wagtail/wagtailadmin/views/chooser.py b/wagtail/wagtailadmin/views/chooser.py index f075dd540..1a2c9a109 100644 --- a/wagtail/wagtailadmin/views/chooser.py +++ b/wagtail/wagtailadmin/views/chooser.py @@ -26,7 +26,7 @@ def browse(request, parent_page_id=None): content_type_app_name, content_type_model_name = page_type.split('.') is_searching = False - is_restricted = page_type != 'wagtailcore.page' + page_types_restricted = page_type != 'wagtailcore.page' try: content_type = ContentType.objects.get_by_natural_key(content_type_app_name, content_type_model_name) @@ -72,7 +72,7 @@ def browse(request, parent_page_id=None): 'is_searching': is_searching, 'page_type_string': page_type, 'page_type': desired_class, - 'is_restricted': is_restricted + 'page_types_restricted': page_types_restricted }) return render_modal_workflow(request, 'wagtailadmin/chooser/browse.html', 'wagtailadmin/chooser/browse.js', { @@ -85,7 +85,7 @@ def browse(request, parent_page_id=None): 'is_searching': False, 'page_type_string': page_type, 'page_type': desired_class, - 'is_restricted': is_restricted + 'page_types_restricted': page_types_restricted }) From bcff4958276d32251df8ba0accf921fdde04671a Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Tue, 26 Aug 2014 17:22:32 +0100 Subject: [PATCH 49/66] Added versionchanged comment for indexed->index rename --- docs/core_components/search/for_python_developers.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/core_components/search/for_python_developers.rst b/docs/core_components/search/for_python_developers.rst index eecd5646a..b254a2e1f 100644 --- a/docs/core_components/search/for_python_developers.rst +++ b/docs/core_components/search/for_python_developers.rst @@ -37,6 +37,10 @@ Indexing extra fields The ``indexed_fields`` configuration format was replaced with ``search_fields`` +.. versionchanged:: 0.6 + + The ``wagtail.wagtailsearch.indexed`` module was renamed to ``wagtail.wagtailsearch.index`` + .. warning:: From 61278ddfcdc27b45fede3929a7d649e8a2433f4e Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 09:46:05 +0100 Subject: [PATCH 50/66] Updated migrations --- .../migrations/0003_auto_20140827_0401.py | 259 ++++++++++++++++++ .../wagtailcore/migrations/0001_initial.py | 62 ++--- .../wagtaildocs/migrations/0001_initial.py | 15 +- .../wagtailembeds/migrations/0001_initial.py | 6 +- .../wagtailforms/migrations/0001_initial.py | 4 +- .../wagtailimages/migrations/0001_initial.py | 36 +-- .../migrations/0001_initial.py | 14 +- .../wagtailsearch/migrations/0001_initial.py | 28 +- .../wagtailusers/migrations/0001_initial.py | 2 +- 9 files changed, 344 insertions(+), 82 deletions(-) create mode 100644 wagtail/tests/migrations/0003_auto_20140827_0401.py diff --git a/wagtail/tests/migrations/0003_auto_20140827_0401.py b/wagtail/tests/migrations/0003_auto_20140827_0401.py new file mode 100644 index 000000000..61d7f2d5c --- /dev/null +++ b/wagtail/tests/migrations/0003_auto_20140827_0401.py @@ -0,0 +1,259 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import modelcluster.fields +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0002_initial_data'), + ('tests', '0002_auto_20140728_1636'), + ] + + operations = [ + migrations.CreateModel( + name='AdvertPlacement', + fields=[ + ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), + ('advert', models.ForeignKey(to='tests.Advert', related_name='+')), + ('page', modelcluster.fields.ParentalKey(to='wagtailcore.Page', related_name='advert_placements')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.AlterModelOptions( + name='eventpagecarouselitem', + options={'ordering': ['sort_order']}, + ), + migrations.AlterModelOptions( + name='eventpagerelatedlink', + options={'ordering': ['sort_order']}, + ), + migrations.AlterModelOptions( + name='eventpagespeaker', + options={'ordering': ['sort_order']}, + ), + migrations.AlterModelOptions( + name='formfield', + options={'ordering': ['sort_order']}, + ), + migrations.AlterField( + model_name='businesschild', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='businessindex', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='businesssubindex', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='customuser', + name='groups', + field=models.ManyToManyField(help_text='The groups this user belongs to. A user will get all permissions granted to each of his/her group.', to='auth.Group', related_name='user_set', related_query_name='user', blank=True, verbose_name='groups'), + ), + migrations.AlterField( + model_name='customuser', + name='user_permissions', + field=models.ManyToManyField(help_text='Specific permissions for this user.', to='auth.Permission', related_name='user_set', related_query_name='user', blank=True, verbose_name='user permissions'), + ), + migrations.AlterField( + model_name='eventindex', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='eventpage', + name='audience', + field=models.CharField(choices=[('public', 'Public'), ('private', 'Private')], max_length=255), + ), + migrations.AlterField( + model_name='eventpage', + name='date_from', + field=models.DateField(verbose_name='Start date', null=True), + ), + migrations.AlterField( + model_name='eventpage', + name='date_to', + field=models.DateField(help_text='Not required if event is on a single day', verbose_name='End date', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpage', + name='feed_image', + field=models.ForeignKey(to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpage', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='eventpage', + name='time_from', + field=models.TimeField(verbose_name='Start time', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpage', + name='time_to', + field=models.TimeField(verbose_name='End time', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='embed_url', + field=models.URLField(verbose_name='Embed URL', blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='image', + field=models.ForeignKey(to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='link_document', + field=models.ForeignKey(to='wagtaildocs.Document', related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='link_page', + field=models.ForeignKey(to='wagtailcore.Page', related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='carousel_items'), + ), + migrations.AlterField( + model_name='eventpagerelatedlink', + name='link_document', + field=models.ForeignKey(to='wagtaildocs.Document', related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='eventpagerelatedlink', + name='link_page', + field=models.ForeignKey(to='wagtailcore.Page', related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='related_links'), + ), + migrations.AlterField( + model_name='eventpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='first_name', + field=models.CharField(max_length=255, verbose_name='Name', blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='image', + field=models.ForeignKey(to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='last_name', + field=models.CharField(max_length=255, verbose_name='Surname', blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='link_document', + field=models.ForeignKey(to='wagtaildocs.Document', related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='link_page', + field=models.ForeignKey(to='wagtailcore.Page', related_name='+', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='speakers'), + ), + migrations.AlterField( + model_name='formfield', + name='field_type', + field=models.CharField(choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], max_length=16), + ), + migrations.AlterField( + model_name='formfield', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.FormPage', related_name='form_fields'), + ), + migrations.AlterField( + model_name='formpage', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='pagewitholdstyleroutemethod', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='routablepagetest', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='searchtestchild', + name='searchtest_ptr', + field=models.OneToOneField(serialize=False, to='tests.SearchTest', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='simplepage', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='standardchild', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='standardindex', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='taggedpage', + name='page_ptr', + field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), + ), + migrations.AlterField( + model_name='taggedpagetag', + name='content_object', + field=modelcluster.fields.ParentalKey(to='tests.TaggedPage', related_name='tagged_items'), + ), + migrations.AlterField( + model_name='taggedpagetag', + name='tag', + field=models.ForeignKey(to='taggit.Tag', related_name='tests_taggedpagetag_items'), + ), + ] diff --git a/wagtail/wagtailcore/migrations/0001_initial.py b/wagtail/wagtailcore/migrations/0001_initial.py index 3cb27f59b..304d53322 100644 --- a/wagtail/wagtailcore/migrations/0001_initial.py +++ b/wagtail/wagtailcore/migrations/0001_initial.py @@ -3,24 +3,24 @@ from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings -import wagtail.wagtailsearch.indexed +import wagtail.wagtailsearch.index class Migration(migrations.Migration): dependencies = [ - ('contenttypes', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('auth', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('contenttypes', '0001_initial'), ] operations = [ migrations.CreateModel( name='GroupPagePermission', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('permission_type', models.CharField(max_length=20, choices=[(b'add', b'Add'), (b'edit', b'Edit'), (b'publish', b'Publish')])), - ('group', models.ForeignKey(to='auth.Group')), + ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), + ('permission_type', models.CharField(choices=[('add', 'Add'), ('edit', 'Edit'), ('publish', 'Publish')], max_length=20)), + ('group', models.ForeignKey(to='auth.Group', related_name='page_permissions')), ], options={ }, @@ -29,45 +29,39 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Page', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('path', models.CharField(unique=True, max_length=255)), + ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), + ('path', models.CharField(max_length=255, unique=True)), ('depth', models.PositiveIntegerField()), ('numchild', models.PositiveIntegerField(default=0)), - ('title', models.CharField(help_text="The page title as you'd like it to be seen by the public", max_length=255)), + ('title', models.CharField(max_length=255, help_text="The page title as you'd like it to be seen by the public")), ('slug', models.SlugField(help_text='The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/')), ('live', models.BooleanField(default=True, editable=False)), ('has_unpublished_changes', models.BooleanField(default=False, editable=False)), - ('url_path', models.CharField(max_length=255, editable=False, blank=True)), - ('seo_title', models.CharField(help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", max_length=255, verbose_name='Page title', blank=True)), + ('url_path', models.CharField(blank=True, max_length=255, editable=False)), + ('seo_title', models.CharField(blank=True, max_length=255, help_text="Optional. 'Search Engine Friendly' title. This will appear at the top of the browser window.", verbose_name='Page title')), ('show_in_menus', models.BooleanField(default=False, help_text='Whether a link to this page will appear in automatically generated menus')), ('search_description', models.TextField(blank=True)), - ('go_live_at', models.DateTimeField(help_text='Please add a date-time in the form YYYY-MM-DD hh:mm.', null=True, verbose_name='Go live date/time', blank=True)), - ('expire_at', models.DateTimeField(help_text='Please add a date-time in the form YYYY-MM-DD hh:mm.', null=True, verbose_name='Expiry date/time', blank=True)), + ('go_live_at', models.DateTimeField(blank=True, verbose_name='Go live date/time', null=True, help_text='Please add a date-time in the form YYYY-MM-DD hh:mm:ss.')), + ('expire_at', models.DateTimeField(blank=True, verbose_name='Expiry date/time', null=True, help_text='Please add a date-time in the form YYYY-MM-DD hh:mm:ss.')), ('expired', models.BooleanField(default=False, editable=False)), - ('content_type', models.ForeignKey(to='contenttypes.ContentType')), - ('owner', models.ForeignKey(blank=True, editable=False, to=settings.AUTH_USER_MODEL, null=True)), + ('content_type', models.ForeignKey(to='contenttypes.ContentType', related_name='pages')), + ('owner', models.ForeignKey(blank=True, null=True, to=settings.AUTH_USER_MODEL, editable=False, related_name='owned_pages')), ], options={ 'abstract': False, }, - bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), - ), - migrations.AddField( - model_name='grouppagepermission', - name='page', - field=models.ForeignKey(to='wagtailcore.Page'), - preserve_default=True, + bases=(models.Model, wagtail.wagtailsearch.index.Indexed), ), migrations.CreateModel( name='PageRevision', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), ('submitted_for_moderation', models.BooleanField(default=False)), ('created_at', models.DateTimeField(auto_now_add=True)), ('content_json', models.TextField()), - ('approved_go_live_at', models.DateTimeField(null=True, blank=True)), - ('page', models.ForeignKey(to='wagtailcore.Page')), - ('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True)), + ('approved_go_live_at', models.DateTimeField(blank=True, null=True)), + ('page', models.ForeignKey(to='wagtailcore.Page', related_name='revisions')), + ('user', models.ForeignKey(blank=True, null=True, to=settings.AUTH_USER_MODEL)), ], options={ }, @@ -76,9 +70,9 @@ class Migration(migrations.Migration): migrations.CreateModel( name='PageViewRestriction', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), ('password', models.CharField(max_length=255)), - ('page', models.ForeignKey(to='wagtailcore.Page')), + ('page', models.ForeignKey(to='wagtailcore.Page', related_name='view_restrictions')), ], options={ }, @@ -87,11 +81,11 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Site', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), ('hostname', models.CharField(max_length=255, db_index=True)), ('port', models.IntegerField(default=80, help_text='Set this to something other than 80 if you need a specific port number to appear in URLs (e.g. development on port 8000). Does not affect request handling (so port forwarding still works).')), ('is_default_site', models.BooleanField(default=False, help_text='If true, this site will handle requests for all other hostnames that do not have a site entry of their own')), - ('root_page', models.ForeignKey(to='wagtailcore.Page')), + ('root_page', models.ForeignKey(to='wagtailcore.Page', related_name='sites_rooted_here')), ], options={ }, @@ -99,6 +93,12 @@ class Migration(migrations.Migration): ), migrations.AlterUniqueTogether( name='site', - unique_together=set([(b'hostname', b'port')]), + unique_together=set([('hostname', 'port')]), + ), + migrations.AddField( + model_name='grouppagepermission', + name='page', + field=models.ForeignKey(to='wagtailcore.Page', related_name='group_permissions'), + preserve_default=True, ), ] diff --git a/wagtail/wagtaildocs/migrations/0001_initial.py b/wagtail/wagtaildocs/migrations/0001_initial.py index 2ca725717..83eac36ea 100644 --- a/wagtail/wagtaildocs/migrations/0001_initial.py +++ b/wagtail/wagtaildocs/migrations/0001_initial.py @@ -2,16 +2,15 @@ from __future__ import unicode_literals from django.db import models, migrations -from django.conf import settings -import taggit.models -import wagtail.wagtailadmin.taggable import taggit.managers +from django.conf import settings +import wagtail.wagtailadmin.taggable class Migration(migrations.Migration): dependencies = [ - ('taggit', '__latest__'), + ('taggit', '0002_auto_20140827_0349'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] @@ -19,12 +18,12 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Document', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=255, verbose_name='Title')), - ('file', models.FileField(upload_to=b'documents', verbose_name='File')), + ('file', models.FileField(upload_to='documents', verbose_name='File')), ('created_at', models.DateTimeField(auto_now_add=True)), - ('tags', taggit.managers.TaggableManager(to=taggit.models.Tag, through=taggit.models.TaggedItem, blank=True, help_text=None, verbose_name='Tags')), - ('uploaded_by_user', models.ForeignKey(blank=True, editable=False, to=settings.AUTH_USER_MODEL, null=True)), + ('tags', taggit.managers.TaggableManager(to='taggit.Tag', verbose_name='Tags', help_text=None, blank=True, through='taggit.TaggedItem')), + ('uploaded_by_user', models.ForeignKey(editable=False, null=True, blank=True, to=settings.AUTH_USER_MODEL)), ], options={ }, diff --git a/wagtail/wagtailembeds/migrations/0001_initial.py b/wagtail/wagtailembeds/migrations/0001_initial.py index e042c074c..86b9e8d4b 100644 --- a/wagtail/wagtailembeds/migrations/0001_initial.py +++ b/wagtail/wagtailembeds/migrations/0001_initial.py @@ -13,10 +13,10 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Embed', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('url', models.URLField()), ('max_width', models.SmallIntegerField(null=True, blank=True)), - ('type', models.CharField(max_length=10, choices=[(b'video', b'Video'), (b'photo', b'Photo'), (b'link', b'Link'), (b'rich', b'Rich')])), + ('type', models.CharField(max_length=10, choices=[('video', 'Video'), ('photo', 'Photo'), ('link', 'Link'), ('rich', 'Rich')])), ('html', models.TextField(blank=True)), ('title', models.TextField(blank=True)), ('author_name', models.TextField(blank=True)), @@ -32,6 +32,6 @@ class Migration(migrations.Migration): ), migrations.AlterUniqueTogether( name='embed', - unique_together=set([(b'url', b'max_width')]), + unique_together=set([('url', 'max_width')]), ), ] diff --git a/wagtail/wagtailforms/migrations/0001_initial.py b/wagtail/wagtailforms/migrations/0001_initial.py index 868defc9e..4b28f0ddf 100644 --- a/wagtail/wagtailforms/migrations/0001_initial.py +++ b/wagtail/wagtailforms/migrations/0001_initial.py @@ -7,14 +7,14 @@ from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ - ('wagtailcore', '0001_initial'), + ('wagtailcore', '0002_initial_data'), ] operations = [ migrations.CreateModel( name='FormSubmission', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), ('form_data', models.TextField()), ('submit_time', models.DateTimeField(auto_now_add=True)), ('page', models.ForeignKey(to='wagtailcore.Page')), diff --git a/wagtail/wagtailimages/migrations/0001_initial.py b/wagtail/wagtailimages/migrations/0001_initial.py index 0a72088d9..64bb96257 100644 --- a/wagtail/wagtailimages/migrations/0001_initial.py +++ b/wagtail/wagtailimages/migrations/0001_initial.py @@ -2,12 +2,11 @@ from __future__ import unicode_literals from django.db import models, migrations -import taggit.models +import wagtail.wagtailimages.utils.validators import wagtail.wagtailimages.models -import wagtail.wagtailimages.utils -import wagtail.wagtailadmin.taggable -from django.conf import settings import taggit.managers +from django.conf import settings +import wagtail.wagtailadmin.taggable class Migration(migrations.Migration): @@ -21,8 +20,8 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Filter', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('spec', models.CharField(max_length=255, db_index=True)), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('spec', models.CharField(db_index=True, max_length=255)), ], options={ }, @@ -31,14 +30,18 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Image', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('title', models.CharField(max_length=255, verbose_name='Title')), - ('file', models.ImageField(upload_to=wagtail.wagtailimages.models.get_upload_to, width_field=b'width', height_field=b'height', validators=[wagtail.wagtailimages.utils.validate_image_format], verbose_name='File')), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('title', models.CharField(verbose_name='Title', max_length=255)), + ('file', models.ImageField(width_field='width', upload_to=wagtail.wagtailimages.models.get_upload_to, verbose_name='File', height_field='height', validators=[wagtail.wagtailimages.utils.validators.validate_image_format])), ('width', models.IntegerField(editable=False)), ('height', models.IntegerField(editable=False)), ('created_at', models.DateTimeField(auto_now_add=True)), - ('tags', taggit.managers.TaggableManager(to=taggit.models.Tag, through=taggit.models.TaggedItem, blank=True, help_text=None, verbose_name='Tags')), - ('uploaded_by_user', models.ForeignKey(blank=True, editable=False, to=settings.AUTH_USER_MODEL, null=True)), + ('focal_point_x', models.PositiveIntegerField(editable=False, null=True)), + ('focal_point_y', models.PositiveIntegerField(editable=False, null=True)), + ('focal_point_width', models.PositiveIntegerField(editable=False, null=True)), + ('focal_point_height', models.PositiveIntegerField(editable=False, null=True)), + ('tags', taggit.managers.TaggableManager(verbose_name='Tags', blank=True, help_text=None, to='taggit.Tag', through='taggit.TaggedItem')), + ('uploaded_by_user', models.ForeignKey(editable=False, blank=True, null=True, to=settings.AUTH_USER_MODEL)), ], options={ 'abstract': False, @@ -48,12 +51,13 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Rendition', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('file', models.ImageField(height_field=b'height', width_field=b'width', upload_to=b'images')), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('file', models.ImageField(width_field='width', upload_to='images', height_field='height')), ('width', models.IntegerField(editable=False)), ('height', models.IntegerField(editable=False)), - ('filter', models.ForeignKey(to='wagtailimages.Filter')), - ('image', models.ForeignKey(to='wagtailimages.Image')), + ('focal_point_key', models.CharField(editable=False, max_length=255, null=True)), + ('filter', models.ForeignKey(related_name='+', to='wagtailimages.Filter')), + ('image', models.ForeignKey(related_name='renditions', to='wagtailimages.Image')), ], options={ }, @@ -61,6 +65,6 @@ class Migration(migrations.Migration): ), migrations.AlterUniqueTogether( name='rendition', - unique_together=set([(b'image', b'filter')]), + unique_together=set([('image', 'filter', 'focal_point_key')]), ), ] diff --git a/wagtail/wagtailredirects/migrations/0001_initial.py b/wagtail/wagtailredirects/migrations/0001_initial.py index 5fb268020..98289544d 100644 --- a/wagtail/wagtailredirects/migrations/0001_initial.py +++ b/wagtail/wagtailredirects/migrations/0001_initial.py @@ -7,19 +7,19 @@ from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ - ('wagtailcore', '0001_initial'), + ('wagtailcore', '0002_initial_data'), ] operations = [ migrations.CreateModel( name='Redirect', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('old_path', models.CharField(unique=True, max_length=255, verbose_name='Redirect from', db_index=True)), - ('is_permanent', models.BooleanField(default=True, help_text="Recommended. Permanent redirects ensure search engines forget the old page (the 'Redirect from') and index the new page instead.", verbose_name='Permanent')), - ('redirect_link', models.URLField(verbose_name='Redirect to any URL', blank=True)), - ('redirect_page', models.ForeignKey(verbose_name='Redirect to a page', blank=True, to='wagtailcore.Page', null=True)), - ('site', models.ForeignKey(blank=True, editable=False, to='wagtailcore.Site', null=True)), + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('old_path', models.CharField(verbose_name='Redirect from', max_length=255, unique=True, db_index=True)), + ('is_permanent', models.BooleanField(verbose_name='Permanent', default=True, help_text="Recommended. Permanent redirects ensure search engines forget the old page (the 'Redirect from') and index the new page instead.")), + ('redirect_link', models.URLField(blank=True, verbose_name='Redirect to any URL')), + ('redirect_page', models.ForeignKey(blank=True, null=True, verbose_name='Redirect to a page', to='wagtailcore.Page')), + ('site', models.ForeignKey(blank=True, to='wagtailcore.Site', editable=False, null=True, related_name='redirects')), ], options={ }, diff --git a/wagtail/wagtailsearch/migrations/0001_initial.py b/wagtail/wagtailsearch/migrations/0001_initial.py index ccf27a376..eebd11a6a 100644 --- a/wagtail/wagtailsearch/migrations/0001_initial.py +++ b/wagtail/wagtailsearch/migrations/0001_initial.py @@ -7,46 +7,40 @@ from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ - ('wagtailcore', '0001_initial'), + ('wagtailcore', '0002_initial_data'), ] operations = [ migrations.CreateModel( name='EditorsPick', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), + ('sort_order', models.IntegerField(blank=True, null=True, editable=False)), ('description', models.TextField(blank=True)), ('page', models.ForeignKey(to='wagtailcore.Page')), ], options={ - 'ordering': (b'sort_order',), + 'ordering': ('sort_order',), }, bases=(models.Model,), ), migrations.CreateModel( name='Query', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), ('query_string', models.CharField(unique=True, max_length=255)), ], options={ }, bases=(models.Model,), ), - migrations.AddField( - model_name='editorspick', - name='query', - field=models.ForeignKey(to='wagtailsearch.Query'), - preserve_default=True, - ), migrations.CreateModel( name='QueryDailyHits', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), ('date', models.DateField()), ('hits', models.IntegerField(default=0)), - ('query', models.ForeignKey(to='wagtailsearch.Query')), + ('query', models.ForeignKey(to='wagtailsearch.Query', related_name='daily_hits')), ], options={ }, @@ -54,6 +48,12 @@ class Migration(migrations.Migration): ), migrations.AlterUniqueTogether( name='querydailyhits', - unique_together=set([(b'query', b'date')]), + unique_together=set([('query', 'date')]), + ), + migrations.AddField( + model_name='editorspick', + name='query', + field=models.ForeignKey(to='wagtailsearch.Query', related_name='editors_picks'), + preserve_default=True, ), ] diff --git a/wagtail/wagtailusers/migrations/0001_initial.py b/wagtail/wagtailusers/migrations/0001_initial.py index 6855c6c57..e1968c0f1 100644 --- a/wagtail/wagtailusers/migrations/0001_initial.py +++ b/wagtail/wagtailusers/migrations/0001_initial.py @@ -15,7 +15,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='UserProfile', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), ('submitted_notifications', models.BooleanField(default=True, help_text='Receive notification when a page is submitted for moderation')), ('approved_notifications', models.BooleanField(default=True, help_text='Receive notification when your page edit is approved')), ('rejected_notifications', models.BooleanField(default=True, help_text='Receive notification when your page edit is rejected')), From f4b247d8a5d5b5ce1fe6562ffa8618dc34dd91ab Mon Sep 17 00:00:00 2001 From: pvetch <paul.vetch@torchbox.com> Date: Wed, 27 Aug 2014 10:28:35 +0100 Subject: [PATCH 51/66] Update README.rst Fixed broken link to form builder docs --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f06776221..88106719b 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ Wagtail is a Django content management system built originally for the `Royal Co * Support for tree-based content organisation * Optional preview->submit->approve workflow * Fast out of the box. `Varnish <https://www.varnish-cache.org/>`_-friendly if you need it -* A simple `form builder <file:///home/karl/projects/wagtaildemo/wagtail/docs/_build/html/core_components/form_builder.html>`_ +* A simple `form builder <http://docs.wagtail.io/en/latest/core_components/form_builder.html>`_ * Optional `static site generation <http://docs.wagtail.io/en/latest/contrib_components/static_site_generation.html>`_ * Excellent `test coverage <https://coveralls.io/r/torchbox/wagtail?branch=master>`_ From 3a1099e33080e42e7f4f17e9c91b9576ff912627 Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 10:54:58 +0100 Subject: [PATCH 52/66] Make hooks and image formats importing work with Django 1.7 AppConfigs This also fixes #398 --- wagtail/tests/settings.py | 10 ++++++++- wagtail/utils/apps.py | 35 ++++++++++++++++++++++++++++++++ wagtail/wagtailcore/hooks.py | 15 +++----------- wagtail/wagtailimages/formats.py | 14 ++----------- 4 files changed, 49 insertions(+), 25 deletions(-) create mode 100644 wagtail/utils/apps.py diff --git a/wagtail/tests/settings.py b/wagtail/tests/settings.py index 32426dba6..da8863e66 100644 --- a/wagtail/tests/settings.py +++ b/wagtail/tests/settings.py @@ -68,7 +68,6 @@ INSTALLED_APPS = [ 'wagtail.wagtailimages', 'wagtail.wagtailembeds', 'wagtail.wagtailsearch', - 'wagtail.wagtailredirects', 'wagtail.wagtailforms', 'wagtail.contrib.wagtailstyleguide', 'wagtail.contrib.wagtailsitemaps', @@ -81,6 +80,15 @@ if django.VERSION[:2] == (1, 6): INSTALLED_APPS.append('south') +# If we are using Django 1.7 install wagtailredirects with its appconfig +# Theres nothing special about wagtailredirects, we just need to have one +# app which uses AppConfigs to test that hooks load properly + +if django.VERSION[:2] == (1, 6): + INSTALLED_APPS.append('wagtail.wagtailredirects') +else: + INSTALLED_APPS.append('wagtail.wagtailredirects.apps.WagtailRedirectsAppConfig') + # As we don't have south migrations for tests, South thinks # the Django 1.7 migrations are South migrations. SOUTH_MIGRATION_MODULES = { diff --git a/wagtail/utils/apps.py b/wagtail/utils/apps.py new file mode 100644 index 000000000..05bf8aa75 --- /dev/null +++ b/wagtail/utils/apps.py @@ -0,0 +1,35 @@ +try: + from importlib import import_module +except ImportError: + # for Python 2.6, fall back on django.utils.importlib (deprecated as of Django 1.7) + from django.utils.importlib import import_module + +import django +from django.conf import settings +from django.utils.module_loading import module_has_submodule + + +def get_app_modules(): + """ + Generator function that yields a module object for each installed app + yields tuples of (app_name, module) + """ + if django.VERSION[:2] == (1, 6): + # Django 1.6 + for app in settings.INSTALLED_APPS: + yield app, import_module(app) + else: + # Django 1.7+ + from django.apps import apps + for app in apps.get_app_configs(): + yield app.name, app.module + + +def get_app_submodules(submodule_name): + """ + Searches each app module for the specified submodule + yields tuples of (app_name, module) + """ + for name, module in get_app_modules(): + if module_has_submodule(module, submodule_name): + yield name, import_module('%s.%s' % (name, submodule_name)) diff --git a/wagtail/wagtailcore/hooks.py b/wagtail/wagtailcore/hooks.py index 958675b97..41955b9d3 100644 --- a/wagtail/wagtailcore/hooks.py +++ b/wagtail/wagtailcore/hooks.py @@ -1,9 +1,5 @@ -from django.conf import settings -try: - from importlib import import_module -except ImportError: - # for Python 2.6, fall back on django.utils.importlib (deprecated as of Django 1.7) - from django.utils.importlib import import_module +from wagtail.utils.apps import get_app_submodules + _hooks = {} @@ -40,12 +36,7 @@ _searched_for_hooks = False def search_for_hooks(): global _searched_for_hooks if not _searched_for_hooks: - for app_module in settings.INSTALLED_APPS: - try: - import_module('%s.wagtail_hooks' % app_module) - except ImportError: - continue - + list(get_app_submodules('wagtail_hooks')) _searched_for_hooks = True diff --git a/wagtail/wagtailimages/formats.py b/wagtail/wagtailimages/formats.py index d00b65b44..3c5644a07 100644 --- a/wagtail/wagtailimages/formats.py +++ b/wagtail/wagtailimages/formats.py @@ -1,11 +1,6 @@ -from django.conf import settings from django.utils.html import escape -try: - from importlib import import_module -except ImportError: - # for Python 2.6, fall back on django.utils.importlib (deprecated as of Django 1.7) - from django.utils.importlib import import_module +from wagtail.utils.apps import get_app_submodules class Format(object): @@ -85,12 +80,7 @@ _searched_for_image_formats = False def search_for_image_formats(): global _searched_for_image_formats if not _searched_for_image_formats: - for app_module in settings.INSTALLED_APPS: - try: - import_module('%s.image_formats' % app_module) - except ImportError: - continue - + list(get_app_submodules('image_formats')) _searched_for_image_formats = True From 1e0bd57415846e8f2b1abe8f203c42d85612e7fa Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 11:00:22 +0100 Subject: [PATCH 53/66] Fixed bad migration dependency --- wagtail/wagtaildocs/migrations/0001_initial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/wagtaildocs/migrations/0001_initial.py b/wagtail/wagtaildocs/migrations/0001_initial.py index 83eac36ea..dd8e4ac62 100644 --- a/wagtail/wagtaildocs/migrations/0001_initial.py +++ b/wagtail/wagtaildocs/migrations/0001_initial.py @@ -10,7 +10,7 @@ import wagtail.wagtailadmin.taggable class Migration(migrations.Migration): dependencies = [ - ('taggit', '0002_auto_20140827_0349'), + ('taggit', '__latest__'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] From bab28400de8b04a9991ab4906a0be19c7db6caa0 Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 11:11:00 +0100 Subject: [PATCH 54/66] Updated django-taggit to 0.12.1 --- setup.py | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 109db840a..c722911ad 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ install_requires = [ "django-compressor>=1.4", "django-libsass>=0.2", "django-modelcluster>=0.3", - "django-taggit==0.12.0", + "django-taggit==0.12.1", "django-treebeard==2.0", "Pillow>=2.3.0", "beautifulsoup4>=4.3.2", diff --git a/tox.ini b/tox.ini index c99af4570..6377c0862 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ base = django-compressor>=1.4 django-libsass>=0.2 django-modelcluster>=0.3 - django-taggit==0.12.0 + django-taggit==0.12.1 django-treebeard==2.0 Pillow>=2.3.0 beautifulsoup4>=4.3.2 From 68559e5cc1ad044b492b1042e1ff5eea8f165ae4 Mon Sep 17 00:00:00 2001 From: Matt Westcott <matt@west.co.tt> Date: Wed, 27 Aug 2014 11:22:05 +0100 Subject: [PATCH 55/66] release note for #506 --- docs/releases/0.6.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/releases/0.6.rst b/docs/releases/0.6.rst index aa0b29960..2b86b58e8 100644 --- a/docs/releases/0.6.rst +++ b/docs/releases/0.6.rst @@ -19,6 +19,7 @@ Bug fixes ~~~~~~~~~ * Page URL generation now returns correct URLs for sites that have the main 'serve' view rooted somewhere other than '/'. + * Search results in the page chooser now respect the page_type parameter on PageChooserPanel. Upgrade considerations ====================== From 2db38a18c1902aff01ca5c59754ed392b195e4b2 Mon Sep 17 00:00:00 2001 From: Matt Westcott <matt@west.co.tt> Date: Wed, 27 Aug 2014 11:28:42 +0100 Subject: [PATCH 56/66] changelog entry for #506 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 14b1bcd1f..c8b078992 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ Changelog * Added RoutablePageMixin (@timheap) * Renamed wagtailsearch.indexed to wagtailsearch.index * Fix: Page URL generation now returns correct URLs for sites that have the main 'serve' view rooted somewhere other than '/' + * Fix: Search results in the page chooser now respect the page_type parameter on PageChooserPanel 0.5 (01.08.2014) ~~~~~~~~~~~~~~~~ From fa482d372ddc97529b3d96dff9a9dec10fd26fe9 Mon Sep 17 00:00:00 2001 From: Matt Westcott <matt@west.co.tt> Date: Wed, 27 Aug 2014 12:46:33 +0100 Subject: [PATCH 57/66] indexed -> index in EventPage --- wagtail/tests/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wagtail/tests/models.py b/wagtail/tests/models.py index 1365d5213..0fc74441e 100644 --- a/wagtail/tests/models.py +++ b/wagtail/tests/models.py @@ -229,9 +229,9 @@ class EventPage(Page): ) search_fields = ( - indexed.SearchField('get_audience_display'), - indexed.SearchField('location'), - indexed.SearchField('body'), + index.SearchField('get_audience_display'), + index.SearchField('location'), + index.SearchField('body'), ) password_required_template = 'tests/event_page_password_required.html' From 558a8c829f66621ff79d0152c188deee9c356578 Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 12:49:43 +0100 Subject: [PATCH 58/66] Minor tweak to Indexed.get_search_fields() --- wagtail/wagtailsearch/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wagtail/wagtailsearch/index.py b/wagtail/wagtailsearch/index.py index 52c53a6ae..82790c580 100644 --- a/wagtail/wagtailsearch/index.py +++ b/wagtail/wagtailsearch/index.py @@ -37,7 +37,7 @@ class Indexed(object): @classmethod def get_search_fields(cls): - return getattr(cls, 'search_fields', tuple()) + return cls.search_fields @classmethod def get_searchable_search_fields(cls): @@ -51,7 +51,7 @@ class Indexed(object): def get_indexed_objects(cls): return cls.objects.all() - indexed_fields = () + search_fields = () class BaseField(object): From e15134ecb3666e040cef427a4dc2a86067d671f9 Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 15:09:52 +0100 Subject: [PATCH 59/66] Remade migrations for tests app --- .../migrations/0002_auto_20140728_1636.py | 341 ---------------- .../migrations/0002_auto_20140827_0908.py | 386 ++++++++++++++++++ .../migrations/0003_auto_20140827_0401.py | 259 ------------ 3 files changed, 386 insertions(+), 600 deletions(-) delete mode 100644 wagtail/tests/migrations/0002_auto_20140728_1636.py create mode 100644 wagtail/tests/migrations/0002_auto_20140827_0908.py delete mode 100644 wagtail/tests/migrations/0003_auto_20140827_0401.py diff --git a/wagtail/tests/migrations/0002_auto_20140728_1636.py b/wagtail/tests/migrations/0002_auto_20140728_1636.py deleted file mode 100644 index 9725c0ebc..000000000 --- a/wagtail/tests/migrations/0002_auto_20140728_1636.py +++ /dev/null @@ -1,341 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import django.db.models.deletion -import taggit.models -import wagtail.wagtailsearch.indexed -import modelcluster.fields -import wagtail.wagtailcore.fields -import modelcluster.tags -import wagtail.tests.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('wagtailcore', '0002_initial_data'), - ('wagtaildocs', '0002_initial_data'), - ('wagtailimages', '0002_initial_data'), - ('taggit', '0001_initial'), - ('tests', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Advert', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('url', models.URLField(null=True, blank=True)), - ('text', models.CharField(max_length=255)), - ], - options={ - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='AlphaSnippet', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('text', models.CharField(max_length=255)), - ], - options={ - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='BusinessChild', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='BusinessIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='BusinessSubIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='EventIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='EventPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('date_from', models.DateField(null=True, verbose_name=b'Start date')), - ('date_to', models.DateField(help_text=b'Not required if event is on a single day', null=True, verbose_name=b'End date', blank=True)), - ('time_from', models.TimeField(null=True, verbose_name=b'Start time', blank=True)), - ('time_to', models.TimeField(null=True, verbose_name=b'End time', blank=True)), - ('audience', models.CharField(max_length=255, choices=[(b'public', b'Public'), (b'private', b'Private')])), - ('location', models.CharField(max_length=255)), - ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), - ('cost', models.CharField(max_length=255)), - ('signup_link', models.URLField(blank=True)), - ('feed_image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='EventPageCarouselItem', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('link_external', models.URLField(verbose_name=b'External link', blank=True)), - ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), - ('caption', models.CharField(max_length=255, blank=True)), - ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), - ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), - ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), - ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='EventPageRelatedLink', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('link_external', models.URLField(verbose_name=b'External link', blank=True)), - ('title', models.CharField(help_text=b'Link title', max_length=255)), - ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), - ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), - ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='EventPageSpeaker', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('link_external', models.URLField(verbose_name=b'External link', blank=True)), - ('first_name', models.CharField(max_length=255, verbose_name=b'Name', blank=True)), - ('last_name', models.CharField(max_length=255, verbose_name=b'Surname', blank=True)), - ('image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), - ('link_document', models.ForeignKey(blank=True, to='wagtaildocs.Document', null=True)), - ('link_page', models.ForeignKey(blank=True, to='wagtailcore.Page', null=True)), - ('page', modelcluster.fields.ParentalKey(to='tests.EventPage')), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='FormField', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), - ('label', models.CharField(help_text='The label of the form field', max_length=255)), - ('field_type', models.CharField(max_length=16, choices=[(b'singleline', 'Single line text'), (b'multiline', 'Multi-line text'), (b'email', 'Email'), (b'number', 'Number'), (b'url', 'URL'), (b'checkbox', 'Checkbox'), (b'checkboxes', 'Checkboxes'), (b'dropdown', 'Drop down'), (b'radio', 'Radio buttons'), (b'date', 'Date'), (b'datetime', 'Date/time')])), - ('required', models.BooleanField(default=True)), - ('choices', models.CharField(help_text='Comma seperated list of choices. Only applicable in checkboxes, radio and dropdown.', max_length=512, blank=True)), - ('default_value', models.CharField(help_text='Default value. Comma seperated values supported for checkboxes.', max_length=255, blank=True)), - ('help_text', models.CharField(max_length=255, blank=True)), - ], - options={ - 'ordering': [b'sort_order'], - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='FormPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('to_address', models.CharField(help_text='Optional - form submissions will be emailed to this address', max_length=255, blank=True)), - ('from_address', models.CharField(max_length=255, blank=True)), - ('subject', models.CharField(max_length=255, blank=True)), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.AddField( - model_name='formfield', - name='page', - field=modelcluster.fields.ParentalKey(to='tests.FormPage'), - preserve_default=True, - ), - migrations.CreateModel( - name='PageWithOldStyleRouteMethod', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('content', models.TextField()), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='RoutablePageTest', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='SearchTest', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('title', models.CharField(max_length=255)), - ('content', models.TextField()), - ('live', models.BooleanField(default=False)), - ('published_date', models.DateField(null=True)), - ], - options={ - }, - bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), - ), - migrations.CreateModel( - name='SearchTestChild', - fields=[ - ('searchtest_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='tests.SearchTest')), - ('subtitle', models.CharField(max_length=255, null=True, blank=True)), - ('extra_content', models.TextField()), - ], - options={ - }, - bases=('tests.searchtest',), - ), - migrations.CreateModel( - name='SearchTestOldConfig', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ], - options={ - }, - bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), - ), - migrations.CreateModel( - name='SearchTestOldConfigList', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ], - options={ - }, - bases=(models.Model, wagtail.wagtailsearch.indexed.Indexed), - ), - migrations.CreateModel( - name='SimplePage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('content', models.TextField()), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='StandardChild', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='StandardIndex', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='TaggedPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='TaggedPageTag', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ], - options={ - 'abstract': False, - }, - bases=(models.Model,), - ), - migrations.AddField( - model_name='taggedpage', - name='tags', - field=modelcluster.tags.ClusterTaggableManager(to=taggit.models.Tag, through=wagtail.tests.models.TaggedPageTag, blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags'), - preserve_default=True, - ), - migrations.AddField( - model_name='taggedpagetag', - name='content_object', - field=modelcluster.fields.ParentalKey(to='tests.TaggedPage'), - preserve_default=True, - ), - migrations.AddField( - model_name='taggedpagetag', - name='tag', - field=models.ForeignKey(to='taggit.Tag'), - preserve_default=True, - ), - migrations.CreateModel( - name='ZuluSnippet', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('text', models.CharField(max_length=255)), - ], - options={ - }, - bases=(models.Model,), - ), - ] diff --git a/wagtail/tests/migrations/0002_auto_20140827_0908.py b/wagtail/tests/migrations/0002_auto_20140827_0908.py new file mode 100644 index 000000000..c5f12fa72 --- /dev/null +++ b/wagtail/tests/migrations/0002_auto_20140827_0908.py @@ -0,0 +1,386 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +import modelcluster.fields +import wagtail.contrib.wagtailroutablepage.models +import wagtail.wagtailcore.fields +import wagtail.wagtailsearch.index +import modelcluster.tags + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0002_initial_data'), + ('wagtaildocs', '0002_initial_data'), + ('taggit', '0002_auto_20140827_0349'), + ('wagtailimages', '0002_initial_data'), + ('tests', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Advert', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('url', models.URLField(null=True, blank=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AdvertPlacement', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('advert', models.ForeignKey(to='tests.Advert', related_name='+')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AlphaSnippet', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BusinessChild', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BusinessIndex', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BusinessSubIndex', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventIndex', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ('date_from', models.DateField(null=True, verbose_name='Start date')), + ('date_to', models.DateField(null=True, help_text='Not required if event is on a single day', blank=True, verbose_name='End date')), + ('time_from', models.TimeField(null=True, blank=True, verbose_name='Start time')), + ('time_to', models.TimeField(null=True, blank=True, verbose_name='End time')), + ('audience', models.CharField(choices=[('public', 'Public'), ('private', 'Private')], max_length=255)), + ('location', models.CharField(max_length=255)), + ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('cost', models.CharField(max_length=255)), + ('signup_link', models.URLField(blank=True)), + ('feed_image', models.ForeignKey(related_name='+', blank=True, to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventPageCarouselItem', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('sort_order', models.IntegerField(null=True, blank=True, editable=False)), + ('link_external', models.URLField(blank=True, verbose_name='External link')), + ('embed_url', models.URLField(blank=True, verbose_name='Embed URL')), + ('caption', models.CharField(blank=True, max_length=255)), + ('image', models.ForeignKey(related_name='+', blank=True, to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, null=True)), + ('link_document', models.ForeignKey(related_name='+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'abstract': False, + 'ordering': ['sort_order'], + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageRelatedLink', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('sort_order', models.IntegerField(null=True, blank=True, editable=False)), + ('link_external', models.URLField(blank=True, verbose_name='External link')), + ('title', models.CharField(help_text='Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name='+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'abstract': False, + 'ordering': ['sort_order'], + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageSpeaker', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('sort_order', models.IntegerField(null=True, blank=True, editable=False)), + ('link_external', models.URLField(blank=True, verbose_name='External link')), + ('first_name', models.CharField(blank=True, verbose_name='Name', max_length=255)), + ('last_name', models.CharField(blank=True, verbose_name='Surname', max_length=255)), + ('image', models.ForeignKey(related_name='+', blank=True, to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, null=True)), + ('link_document', models.ForeignKey(related_name='+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'abstract': False, + 'ordering': ['sort_order'], + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormField', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('sort_order', models.IntegerField(null=True, blank=True, editable=False)), + ('label', models.CharField(help_text='The label of the form field', max_length=255)), + ('field_type', models.CharField(choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], max_length=16)), + ('required', models.BooleanField(default=True)), + ('choices', models.CharField(blank=True, help_text='Comma seperated list of choices. Only applicable in checkboxes, radio and dropdown.', max_length=512)), + ('default_value', models.CharField(blank=True, help_text='Default value. Comma seperated values supported for checkboxes.', max_length=255)), + ('help_text', models.CharField(blank=True, max_length=255)), + ], + options={ + 'abstract': False, + 'ordering': ['sort_order'], + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ('to_address', models.CharField(blank=True, help_text='Optional - form submissions will be emailed to this address', max_length=255)), + ('from_address', models.CharField(blank=True, max_length=255)), + ('subject', models.CharField(blank=True, max_length=255)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='PageWithOldStyleRouteMethod', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ('content', models.TextField()), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='RoutablePageTest', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=(wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin, 'wagtailcore.page'), + ), + migrations.CreateModel( + name='SearchTest', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('title', models.CharField(max_length=255)), + ('content', models.TextField()), + ('live', models.BooleanField(default=False)), + ('published_date', models.DateField(null=True)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.index.Indexed), + ), + migrations.CreateModel( + name='SearchTestChild', + fields=[ + ('searchtest_ptr', models.OneToOneField(parent_link=True, to='tests.SearchTest', serialize=False, auto_created=True, primary_key=True)), + ('subtitle', models.CharField(null=True, blank=True, max_length=255)), + ('extra_content', models.TextField()), + ], + options={ + }, + bases=('tests.searchtest',), + ), + migrations.CreateModel( + name='SearchTestOldConfig', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.index.Indexed), + ), + migrations.CreateModel( + name='SearchTestOldConfigList', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ], + options={ + }, + bases=(models.Model, wagtail.wagtailsearch.index.Indexed), + ), + migrations.CreateModel( + name='SimplePage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ('content', models.TextField()), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardChild', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardIndex', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='TaggedPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', serialize=False, auto_created=True, primary_key=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='TaggedPageTag', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('content_object', modelcluster.fields.ParentalKey(to='tests.TaggedPage', related_name='tagged_items')), + ('tag', models.ForeignKey(to='taggit.Tag', related_name='tests_taggedpagetag_items')), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='ZuluSnippet', + fields=[ + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='taggedpage', + name='tags', + field=modelcluster.tags.ClusterTaggableManager(through='tests.TaggedPageTag', blank=True, verbose_name='Tags', to='taggit.Tag', help_text='A comma-separated list of tags.'), + preserve_default=True, + ), + migrations.AddField( + model_name='formfield', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.FormPage', related_name='form_fields'), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagespeaker', + name='link_page', + field=models.ForeignKey(related_name='+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagespeaker', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='speakers'), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name='+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='related_links'), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagecarouselitem', + name='link_page', + field=models.ForeignKey(related_name='+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagecarouselitem', + name='page', + field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='carousel_items'), + preserve_default=True, + ), + migrations.AddField( + model_name='advertplacement', + name='page', + field=modelcluster.fields.ParentalKey(to='wagtailcore.Page', related_name='advert_placements'), + preserve_default=True, + ), + migrations.AlterField( + model_name='customuser', + name='groups', + field=models.ManyToManyField(related_name='user_set', blank=True, verbose_name='groups', to='auth.Group', related_query_name='user', help_text='The groups this user belongs to. A user will get all permissions granted to each of his/her group.'), + ), + migrations.AlterField( + model_name='customuser', + name='user_permissions', + field=models.ManyToManyField(related_name='user_set', blank=True, verbose_name='user permissions', to='auth.Permission', related_query_name='user', help_text='Specific permissions for this user.'), + ), + ] diff --git a/wagtail/tests/migrations/0003_auto_20140827_0401.py b/wagtail/tests/migrations/0003_auto_20140827_0401.py deleted file mode 100644 index 61d7f2d5c..000000000 --- a/wagtail/tests/migrations/0003_auto_20140827_0401.py +++ /dev/null @@ -1,259 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import modelcluster.fields -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('wagtailcore', '0002_initial_data'), - ('tests', '0002_auto_20140728_1636'), - ] - - operations = [ - migrations.CreateModel( - name='AdvertPlacement', - fields=[ - ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), - ('advert', models.ForeignKey(to='tests.Advert', related_name='+')), - ('page', modelcluster.fields.ParentalKey(to='wagtailcore.Page', related_name='advert_placements')), - ], - options={ - }, - bases=(models.Model,), - ), - migrations.AlterModelOptions( - name='eventpagecarouselitem', - options={'ordering': ['sort_order']}, - ), - migrations.AlterModelOptions( - name='eventpagerelatedlink', - options={'ordering': ['sort_order']}, - ), - migrations.AlterModelOptions( - name='eventpagespeaker', - options={'ordering': ['sort_order']}, - ), - migrations.AlterModelOptions( - name='formfield', - options={'ordering': ['sort_order']}, - ), - migrations.AlterField( - model_name='businesschild', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='businessindex', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='businesssubindex', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='customuser', - name='groups', - field=models.ManyToManyField(help_text='The groups this user belongs to. A user will get all permissions granted to each of his/her group.', to='auth.Group', related_name='user_set', related_query_name='user', blank=True, verbose_name='groups'), - ), - migrations.AlterField( - model_name='customuser', - name='user_permissions', - field=models.ManyToManyField(help_text='Specific permissions for this user.', to='auth.Permission', related_name='user_set', related_query_name='user', blank=True, verbose_name='user permissions'), - ), - migrations.AlterField( - model_name='eventindex', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='eventpage', - name='audience', - field=models.CharField(choices=[('public', 'Public'), ('private', 'Private')], max_length=255), - ), - migrations.AlterField( - model_name='eventpage', - name='date_from', - field=models.DateField(verbose_name='Start date', null=True), - ), - migrations.AlterField( - model_name='eventpage', - name='date_to', - field=models.DateField(help_text='Not required if event is on a single day', verbose_name='End date', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpage', - name='feed_image', - field=models.ForeignKey(to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpage', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='eventpage', - name='time_from', - field=models.TimeField(verbose_name='Start time', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpage', - name='time_to', - field=models.TimeField(verbose_name='End time', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagecarouselitem', - name='embed_url', - field=models.URLField(verbose_name='Embed URL', blank=True), - ), - migrations.AlterField( - model_name='eventpagecarouselitem', - name='image', - field=models.ForeignKey(to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagecarouselitem', - name='link_document', - field=models.ForeignKey(to='wagtaildocs.Document', related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagecarouselitem', - name='link_external', - field=models.URLField(verbose_name='External link', blank=True), - ), - migrations.AlterField( - model_name='eventpagecarouselitem', - name='link_page', - field=models.ForeignKey(to='wagtailcore.Page', related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagecarouselitem', - name='page', - field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='carousel_items'), - ), - migrations.AlterField( - model_name='eventpagerelatedlink', - name='link_document', - field=models.ForeignKey(to='wagtaildocs.Document', related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagerelatedlink', - name='link_external', - field=models.URLField(verbose_name='External link', blank=True), - ), - migrations.AlterField( - model_name='eventpagerelatedlink', - name='link_page', - field=models.ForeignKey(to='wagtailcore.Page', related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagerelatedlink', - name='page', - field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='related_links'), - ), - migrations.AlterField( - model_name='eventpagerelatedlink', - name='title', - field=models.CharField(max_length=255, help_text='Link title'), - ), - migrations.AlterField( - model_name='eventpagespeaker', - name='first_name', - field=models.CharField(max_length=255, verbose_name='Name', blank=True), - ), - migrations.AlterField( - model_name='eventpagespeaker', - name='image', - field=models.ForeignKey(to='wagtailimages.Image', on_delete=django.db.models.deletion.SET_NULL, related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagespeaker', - name='last_name', - field=models.CharField(max_length=255, verbose_name='Surname', blank=True), - ), - migrations.AlterField( - model_name='eventpagespeaker', - name='link_document', - field=models.ForeignKey(to='wagtaildocs.Document', related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagespeaker', - name='link_external', - field=models.URLField(verbose_name='External link', blank=True), - ), - migrations.AlterField( - model_name='eventpagespeaker', - name='link_page', - field=models.ForeignKey(to='wagtailcore.Page', related_name='+', null=True, blank=True), - ), - migrations.AlterField( - model_name='eventpagespeaker', - name='page', - field=modelcluster.fields.ParentalKey(to='tests.EventPage', related_name='speakers'), - ), - migrations.AlterField( - model_name='formfield', - name='field_type', - field=models.CharField(choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], max_length=16), - ), - migrations.AlterField( - model_name='formfield', - name='page', - field=modelcluster.fields.ParentalKey(to='tests.FormPage', related_name='form_fields'), - ), - migrations.AlterField( - model_name='formpage', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='pagewitholdstyleroutemethod', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='routablepagetest', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='searchtestchild', - name='searchtest_ptr', - field=models.OneToOneField(serialize=False, to='tests.SearchTest', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='simplepage', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='standardchild', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='standardindex', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='taggedpage', - name='page_ptr', - field=models.OneToOneField(serialize=False, to='wagtailcore.Page', parent_link=True, auto_created=True, primary_key=True), - ), - migrations.AlterField( - model_name='taggedpagetag', - name='content_object', - field=modelcluster.fields.ParentalKey(to='tests.TaggedPage', related_name='tagged_items'), - ), - migrations.AlterField( - model_name='taggedpagetag', - name='tag', - field=models.ForeignKey(to='taggit.Tag', related_name='tests_taggedpagetag_items'), - ), - ] From e8ea53f8e3165df0ab6c96114cd9ab7745d4d143 Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 15:14:06 +0100 Subject: [PATCH 60/66] Fixed reference to non existant migration --- wagtail/tests/migrations/0002_auto_20140827_0908.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/tests/migrations/0002_auto_20140827_0908.py b/wagtail/tests/migrations/0002_auto_20140827_0908.py index c5f12fa72..66c85ffb0 100644 --- a/wagtail/tests/migrations/0002_auto_20140827_0908.py +++ b/wagtail/tests/migrations/0002_auto_20140827_0908.py @@ -15,7 +15,7 @@ class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0002_initial_data'), ('wagtaildocs', '0002_initial_data'), - ('taggit', '0002_auto_20140827_0349'), + ('taggit', '0001_initial'), ('wagtailimages', '0002_initial_data'), ('tests', '0001_initial'), ] From 075c9e8da03945195149c605dddfbfb63d3e70b7 Mon Sep 17 00:00:00 2001 From: Matt Westcott <matt@west.co.tt> Date: Wed, 27 Aug 2014 15:43:46 +0100 Subject: [PATCH 61/66] add python3 + django 1.7 + sqlite as valid tox config --- tox.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 6377c0862..a3a691f2d 100644 --- a/tox.ini +++ b/tox.ini @@ -47,8 +47,11 @@ envlist = py27-dj17-postgres, py27-dj17-sqlite, py32-dj17-postgres, + py32-dj17-sqlite, py33-dj17-postgres, - py34-dj17-postgres + py33-dj17-sqlite, + py34-dj17-postgres, + py34-dj17-sqlite # mysql not currently supported # (wagtail.wagtailimages.tests.TestImageEditView currently fails with a From 2640258450bd3edf6eccbf9d32cd1b7fe26b1a77 Mon Sep 17 00:00:00 2001 From: Matt Westcott <matt@west.co.tt> Date: Wed, 27 Aug 2014 15:54:00 +0100 Subject: [PATCH 62/66] use the more natural 'django.VERSION < (1.7)' for version tests --- wagtail/tests/settings.py | 4 ++-- wagtail/utils/apps.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wagtail/tests/settings.py b/wagtail/tests/settings.py index da8863e66..e9c1172b4 100644 --- a/wagtail/tests/settings.py +++ b/wagtail/tests/settings.py @@ -76,7 +76,7 @@ INSTALLED_APPS = [ ] # If we are using Django 1.6, add South to INSTALLED_APPS -if django.VERSION[:2] == (1, 6): +if django.VERSION < (1, 7): INSTALLED_APPS.append('south') @@ -84,7 +84,7 @@ if django.VERSION[:2] == (1, 6): # Theres nothing special about wagtailredirects, we just need to have one # app which uses AppConfigs to test that hooks load properly -if django.VERSION[:2] == (1, 6): +if django.VERSION < (1, 7): INSTALLED_APPS.append('wagtail.wagtailredirects') else: INSTALLED_APPS.append('wagtail.wagtailredirects.apps.WagtailRedirectsAppConfig') diff --git a/wagtail/utils/apps.py b/wagtail/utils/apps.py index 05bf8aa75..2bee7484e 100644 --- a/wagtail/utils/apps.py +++ b/wagtail/utils/apps.py @@ -14,7 +14,7 @@ def get_app_modules(): Generator function that yields a module object for each installed app yields tuples of (app_name, module) """ - if django.VERSION[:2] == (1, 6): + if django.VERSION < (1, 7): # Django 1.6 for app in settings.INSTALLED_APPS: yield app, import_module(app) From f471f0bbf6478fe4c54f1b3006ea146d3d8ae0db Mon Sep 17 00:00:00 2001 From: Matt Westcott <matt@west.co.tt> Date: Wed, 27 Aug 2014 15:56:22 +0100 Subject: [PATCH 63/66] avoid using 'self' as a parameter to the non-method form of get_upload_to --- wagtail/wagtailimages/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wagtail/wagtailimages/models.py b/wagtail/wagtailimages/models.py index bee887289..04ae37ad0 100644 --- a/wagtail/wagtailimages/models.py +++ b/wagtail/wagtailimages/models.py @@ -29,9 +29,9 @@ from wagtail.wagtailimages.utils.feature_detection import FeatureDetector, openc from wagtail.wagtailadmin.utils import get_object_usage -def get_upload_to(self, filename): +def get_upload_to(instance, filename): folder_name = 'original_images' - filename = self.file.field.storage.get_valid_name(filename) + filename = instance.file.field.storage.get_valid_name(filename) # do a unidecode in the filename and then # replace non-ascii characters in filename with _ , to sidestep issues with filesystem encoding From 48401244ea90e030de090d34650c78988388f72c Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Wed, 27 Aug 2014 16:08:10 +0100 Subject: [PATCH 64/66] Changelog, readme, docs and release notes for Django 1.7 support --- CHANGELOG.txt | 1 + README.rst | 4 +--- docs/index.rst | 2 +- docs/releases/0.6.rst | 6 ++++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c8b078992..5122b8d1d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ Changelog 0.6 (xx.xx.20xx) ~~~~~~~~~~~~~~~~ + * Added Django 1.7 support * Added {% routablepageurl %} template tag (@timheap) * Added RoutablePageMixin (@timheap) * Renamed wagtailsearch.indexed to wagtailsearch.index diff --git a/README.rst b/README.rst index 88106719b..a2c11cb16 100644 --- a/README.rst +++ b/README.rst @@ -45,9 +45,7 @@ Available at `wagtail.readthedocs.org <http://wagtail.readthedocs.org/>`_ and al Compatibility ~~~~~~~~~~~~~ -Wagtail supports Django 1.6.2+ on Python 2.6, 2.7, 3.2, 3.3 and 3.4. - -Django 1.7 support is in progress pending further release candidate testing. +Wagtail supports Django 1.6.2+ and 1.7rc3+ on Python 2.6, 2.7, 3.2, 3.3 and 3.4. Wagtail's dependencies are summarised at `requirements.io <https://requires.io/github/torchbox/wagtail/requirements>`_. diff --git a/docs/index.rst b/docs/index.rst index 0ce7b02fa..55575fbff 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,7 +3,7 @@ Welcome to Wagtail's documentation Wagtail is a modern, flexible CMS, built on Django. -It supports Django 1.6.2+ on Python 2.6, 2.7, 3.2, 3.3 and 3.4. Django 1.7 support is in progress pending further release candidate testing. +It supports Django 1.6.2+ and 1.7rc3+ on Python 2.6, 2.7, 3.2, 3.3 and 3.4. .. toctree:: :maxdepth: 3 diff --git a/docs/releases/0.6.rst b/docs/releases/0.6.rst index 2b86b58e8..a5fbad591 100644 --- a/docs/releases/0.6.rst +++ b/docs/releases/0.6.rst @@ -10,6 +10,12 @@ Wagtail 0.6 release notes - IN DEVELOPMENT What's new ========== +Django 1.7 support +~~~~~~~~~~~~~~~~~~ + +Wagtail can now be used with Django 1.7. + + Minor features ~~~~~~~~~~~~~~ * A new template tag has been added for reversing URLs inside routable pages. See :ref:`routablepageurl_template_tag`. From f75ec76b3aa71b99111ea47134dacd44ef2c76e1 Mon Sep 17 00:00:00 2001 From: Matt Westcott <matt@west.co.tt> Date: Wed, 27 Aug 2014 17:10:30 +0100 Subject: [PATCH 65/66] fix more documentation links in the readme --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a2c11cb16..77d153f26 100644 --- a/README.rst +++ b/README.rst @@ -53,8 +53,8 @@ Contributing ~~~~~~~~~~~~ If you're a Python or Django developer, fork the repo and get stuck in! -We suggest you start by checking the `Help develop me! <https://github.com/torchbox/wagtail/issues?labels=Help+develop+me%21>`_ label and the `coding guidelines <http://wagtail.readthedocs.org/en/latest/contributing.html#coding-guidelines>`_. +We suggest you start by checking the `Help develop me! <https://github.com/torchbox/wagtail/issues?labels=Help+develop+me%21>`_ label and the `coding guidelines <http://wagtail.readthedocs.org/en/latest/howto/contributing.html#coding-guidelines>`_. Send us a useful pull request and we'll post you a `t-shirt <https://twitter.com/WagtailCMS/status/432166799464210432/photo/1>`_. -We also welcome `translations <http://wagtail.readthedocs.org/en/latest/contributing.html#translations>`_ for Wagtail's interface. +We also welcome `translations <http://wagtail.readthedocs.org/en/latest/howto/contributing.html#translations>`_ for Wagtail's interface. From 0aee07fd5a204cbbafab3092c69e88d62644ff83 Mon Sep 17 00:00:00 2001 From: Karl Hobley <karl@torchbox.com> Date: Thu, 28 Aug 2014 10:33:42 +0100 Subject: [PATCH 66/66] Exclude south_migrations from test coverage --- .coveragerc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 7f6f849cd..b49e59cd5 100644 --- a/.coveragerc +++ b/.coveragerc @@ -5,6 +5,7 @@ branch = True source = wagtail omit = + */south_migrations/* */migrations/* wagtail/vendor/* @@ -31,4 +32,4 @@ exclude_lines = ignore_errors = True [html] -directory = coverage_html_report \ No newline at end of file +directory = coverage_html_report