kopia lustrzana https://github.com/wagtail/wagtail
Sort imports using isort
``` $ pip install isort -e .[testing,docs] $ isort --recursive wagtail/ $ git add wagtail $ git commit ```pull/2284/merge
rodzic
31972dfd9e
commit
861bd2de14
|
@ -2,27 +2,26 @@ from __future__ import absolute_import
|
|||
|
||||
from collections import OrderedDict
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.http import Http404
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.apps import apps
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.http import Http404
|
||||
from rest_framework import status
|
||||
from rest_framework.renderers import BrowsableAPIRenderer, JSONRenderer
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.viewsets import GenericViewSet
|
||||
from rest_framework.renderers import JSONRenderer, BrowsableAPIRenderer
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
from .filters import (
|
||||
FieldsFilter, OrderingFilter, SearchFilter,
|
||||
RestrictedChildOfFilter, RestrictedDescendantOfFilter
|
||||
)
|
||||
FieldsFilter, OrderingFilter, RestrictedChildOfFilter, RestrictedDescendantOfFilter,
|
||||
SearchFilter)
|
||||
from .pagination import WagtailPagination
|
||||
from .serializers import BaseSerializer, PageSerializer, DocumentSerializer, ImageSerializer, get_serializer_class
|
||||
from .utils import BadRequestError, page_models_from_string, filter_page_type
|
||||
from .serializers import (
|
||||
BaseSerializer, DocumentSerializer, ImageSerializer, PageSerializer, get_serializer_class)
|
||||
from .utils import BadRequestError, filter_page_type, page_models_from_string
|
||||
|
||||
|
||||
class BaseAPIEndpoint(GenericViewSet):
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
from django.conf import settings
|
||||
|
||||
from rest_framework.filters import BaseFilterBackend
|
||||
|
||||
from taggit.managers import _TaggableManager
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from rest_framework.pagination import BasePagination
|
||||
from rest_framework.response import Response
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import functools
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from django.conf.urls import include, url
|
||||
|
||||
from wagtail.utils.urlpatterns import decorate_urlpatterns
|
||||
|
||||
|
|
|
@ -2,15 +2,11 @@ from __future__ import absolute_import
|
|||
|
||||
from collections import OrderedDict
|
||||
|
||||
from modelcluster.models import get_all_child_relations
|
||||
|
||||
from django.core.urlresolvers import NoReverseMatch
|
||||
|
||||
from taggit.managers import _TaggableManager
|
||||
|
||||
from rest_framework import serializers
|
||||
from modelcluster.models import get_all_child_relations
|
||||
from rest_framework import relations, serializers
|
||||
from rest_framework.fields import Field, SkipField
|
||||
from rest_framework import relations
|
||||
from taggit.managers import _TaggableManager
|
||||
|
||||
from wagtail.utils.compat import get_related_model
|
||||
from wagtail.wagtailcore import fields as wagtailcore_fields
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.db.models.signals import post_save, post_delete
|
||||
|
||||
from wagtail.wagtailcore.signals import page_published, page_unpublished
|
||||
from wagtail.wagtailcore.models import get_page_models
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
from django.db.models.signals import post_delete, post_save
|
||||
|
||||
from wagtail.contrib.wagtailfrontendcache.utils import purge_url_from_cache
|
||||
from wagtail.wagtailcore.models import get_page_models
|
||||
from wagtail.wagtailcore.signals import page_published, page_unpublished
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
from .utils import get_base_url
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import json
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
|
||||
from wagtail.api.v2 import signal_handlers
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
|
||||
|
||||
class TestDocumentListing(TestCase):
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import json
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
from wagtail.api.v2 import signal_handlers
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
|
||||
class TestImageListing(TestCase):
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
import json
|
||||
import mock
|
||||
import collections
|
||||
import json
|
||||
|
||||
import mock
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
from wagtail.api.v2 import signal_handlers
|
||||
|
||||
from wagtail.tests.demosite import models
|
||||
from wagtail.tests.testapp.models import StreamPage
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
|
||||
def get_total_page_count():
|
||||
|
|
|
@ -2,10 +2,9 @@ from __future__ import absolute_import
|
|||
|
||||
from django.conf.urls import url
|
||||
|
||||
from .endpoints import PagesAPIEndpoint, ImagesAPIEndpoint, DocumentsAPIEndpoint
|
||||
from .endpoints import DocumentsAPIEndpoint, ImagesAPIEndpoint, PagesAPIEndpoint
|
||||
from .router import WagtailAPIRouter
|
||||
|
||||
|
||||
v2 = WagtailAPIRouter('wagtailapi_v2')
|
||||
v2.register_endpoint('pages', PagesAPIEndpoint)
|
||||
v2.register_endpoint('images', ImagesAPIEndpoint)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function, absolute_import
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
|
||||
from optparse import OptionParser
|
||||
|
||||
from django.core.management import ManagementUtility
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.db import models
|
||||
|
||||
from .registry import register_setting
|
||||
|
||||
__all__ = ['BaseSetting', 'register_setting']
|
||||
|
|
|
@ -5,6 +5,7 @@ from django.utils.text import capfirst
|
|||
|
||||
from wagtail.wagtailadmin.menu import MenuItem
|
||||
from wagtail.wagtailcore import hooks
|
||||
|
||||
from .permissions import user_can_edit_setting_type
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.core.exceptions import PermissionDenied
|
||||
from django.http import Http404
|
||||
from django.shortcuts import redirect, render, get_object_or_404
|
||||
from django.shortcuts import get_object_or_404, redirect, render
|
||||
from django.utils.lru_cache import lru_cache
|
||||
from django.utils.text import capfirst
|
||||
from django.utils.translation import ugettext as _
|
||||
|
|
|
@ -3,25 +3,22 @@ from __future__ import absolute_import
|
|||
from collections import OrderedDict
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.http import Http404
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from django.http import Http404
|
||||
from rest_framework import status
|
||||
from rest_framework.renderers import BrowsableAPIRenderer, JSONRenderer
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.viewsets import GenericViewSet
|
||||
from rest_framework.renderers import JSONRenderer, BrowsableAPIRenderer
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
from wagtail.wagtailcore.utils import resolve_model_string
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
from .filters import (
|
||||
FieldsFilter, OrderingFilter, SearchFilter,
|
||||
ChildOfFilter, DescendantOfFilter
|
||||
)
|
||||
from .filters import ChildOfFilter, DescendantOfFilter, FieldsFilter, OrderingFilter, SearchFilter
|
||||
from .pagination import WagtailPagination
|
||||
from .serializers import BaseSerializer, PageSerializer, DocumentSerializer, ImageSerializer, get_serializer_class
|
||||
from .serializers import (
|
||||
BaseSerializer, DocumentSerializer, ImageSerializer, PageSerializer, get_serializer_class)
|
||||
from .utils import BadRequestError
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
from django.conf import settings
|
||||
|
||||
from rest_framework.filters import BaseFilterBackend
|
||||
|
||||
from taggit.managers import _TaggableManager
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from rest_framework.pagination import BasePagination
|
||||
from rest_framework.response import Response
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import functools
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from django.conf.urls import include, url
|
||||
|
||||
from wagtail.utils.urlpatterns import decorate_urlpatterns
|
||||
|
||||
|
|
|
@ -3,12 +3,9 @@ from __future__ import absolute_import
|
|||
from collections import OrderedDict
|
||||
|
||||
from modelcluster.models import get_all_child_relations
|
||||
|
||||
from taggit.managers import _TaggableManager
|
||||
|
||||
from rest_framework import serializers
|
||||
from rest_framework import relations, serializers
|
||||
from rest_framework.fields import Field
|
||||
from rest_framework import relations
|
||||
from taggit.managers import _TaggableManager
|
||||
|
||||
from wagtail.wagtailcore import fields as wagtailcore_fields
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.db.models.signals import post_save, post_delete
|
||||
|
||||
from wagtail.wagtailcore.signals import page_published, page_unpublished
|
||||
from wagtail.wagtailcore.models import get_page_models
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
from django.db.models.signals import post_delete, post_save
|
||||
|
||||
from wagtail.contrib.wagtailfrontendcache.utils import purge_url_from_cache
|
||||
from wagtail.wagtailcore.models import get_page_models
|
||||
from wagtail.wagtailcore.signals import page_published, page_unpublished
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
from .utils import get_base_url
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import json
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
|
||||
from wagtail.contrib.wagtailapi import signal_handlers
|
||||
from wagtail.wagtaildocs.models import Document
|
||||
|
||||
|
||||
class TestDocumentListing(TestCase):
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import json
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
from wagtail.contrib.wagtailapi import signal_handlers
|
||||
from wagtail.wagtailimages.models import get_image_model
|
||||
|
||||
|
||||
class TestImageListing(TestCase):
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
import json
|
||||
import mock
|
||||
import collections
|
||||
import json
|
||||
|
||||
import mock
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
from wagtail.contrib.wagtailapi import signal_handlers
|
||||
|
||||
from wagtail.tests.demosite import models
|
||||
from wagtail.tests.testapp.models import StreamPage
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
|
||||
def get_total_page_count():
|
||||
|
|
|
@ -2,10 +2,9 @@ from __future__ import absolute_import
|
|||
|
||||
from django.conf.urls import url
|
||||
|
||||
from .endpoints import PagesAPIEndpoint, ImagesAPIEndpoint, DocumentsAPIEndpoint
|
||||
from .endpoints import DocumentsAPIEndpoint, ImagesAPIEndpoint, PagesAPIEndpoint
|
||||
from .router import WagtailAPIRouter
|
||||
|
||||
|
||||
v1 = WagtailAPIRouter('wagtailapi_v1')
|
||||
v1.register_endpoint('pages', PagesAPIEndpoint)
|
||||
v1.register_endpoint('images', ImagesAPIEndpoint)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
from wagtail.contrib.wagtailfrontendcache.signal_handlers import register_signal_handlers
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import logging
|
||||
import json
|
||||
import logging
|
||||
|
||||
from django.utils.six.moves.urllib.parse import urlparse, urlunparse, urlencode
|
||||
from django.utils.six.moves.urllib.error import HTTPError, URLError
|
||||
from django.utils.six.moves.urllib.parse import urlencode, urlparse, urlunparse
|
||||
from django.utils.six.moves.urllib.request import Request, urlopen
|
||||
from django.utils.six.moves.urllib.error import URLError, HTTPError
|
||||
|
||||
from wagtail.wagtailcore import __version__
|
||||
|
||||
|
||||
logger = logging.getLogger('wagtail.frontendcache')
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
from django.apps import apps
|
||||
|
||||
from wagtail.wagtailcore.signals import page_published, page_unpublished
|
||||
|
||||
from wagtail.contrib.wagtailfrontendcache.utils import purge_page_from_cache
|
||||
from wagtail.wagtailcore.signals import page_published, page_unpublished
|
||||
|
||||
|
||||
def page_published_signal_handler(instance, **kwargs):
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.tests.testapp.models import EventIndex
|
||||
|
||||
from wagtail.contrib.wagtailfrontendcache.backends import (
|
||||
BaseBackend, CloudflareBackend, HTTPBackend)
|
||||
from wagtail.contrib.wagtailfrontendcache.utils import get_backends
|
||||
from wagtail.contrib.wagtailfrontendcache.backends import HTTPBackend, CloudflareBackend, BaseBackend
|
||||
from wagtail.tests.testapp.models import EventIndex
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
|
||||
class TestBackendConfiguration(TestCase):
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import logging
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.module_loading import import_string
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
logger = logging.getLogger('wagtail.frontendcache')
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.http import Http404
|
||||
from django.core.urlresolvers import RegexURLResolver
|
||||
from django.conf.urls import url
|
||||
from django.core.urlresolvers import RegexURLResolver
|
||||
from django.http import Http404
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailcore.url_routing import RouteResult
|
||||
|
||||
|
||||
_creation_counter = 0
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from django import template
|
||||
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from django.test import TestCase, RequestFactory
|
||||
from django.core.urlresolvers import NoReverseMatch
|
||||
from django.test import RequestFactory, TestCase
|
||||
|
||||
from wagtail.wagtailcore.models import Page, Site
|
||||
from wagtail.contrib.wagtailroutablepage.templatetags.wagtailroutablepage_tags import \
|
||||
routablepageurl
|
||||
from wagtail.tests.routablepage.models import RoutablePageTest
|
||||
from wagtail.contrib.wagtailroutablepage.templatetags.wagtailroutablepage_tags import routablepageurl
|
||||
from wagtail.wagtailcore.models import Page, Site
|
||||
|
||||
|
||||
class TestRoutablePage(TestCase):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.conf.urls import url
|
||||
from wagtail.contrib.wagtailsearchpromotions import views
|
||||
|
||||
from wagtail.contrib.wagtailsearchpromotions import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.index, name='index'),
|
||||
|
|
|
@ -2,9 +2,9 @@ from django import forms
|
|||
from django.forms.models import inlineformset_factory
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from wagtail.contrib.wagtailsearchpromotions.models import SearchPromotion
|
||||
from wagtail.wagtailadmin.widgets import AdminPageChooser
|
||||
from wagtail.wagtailsearch.models import Query
|
||||
from wagtail.contrib.wagtailsearchpromotions.models import SearchPromotion
|
||||
|
||||
|
||||
class SearchPromotionForm(forms.ModelForm):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
from django import template
|
||||
|
||||
from wagtail.wagtailsearch.models import Query
|
||||
from wagtail.contrib.wagtailsearchpromotions.models import SearchPromotion
|
||||
|
||||
from wagtail.wagtailsearch.models import Query
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.contrib.wagtailsearchpromotions.models import SearchPromotion
|
||||
from wagtail.contrib.wagtailsearchpromotions.templatetags.wagtailsearchpromotions_tags import \
|
||||
get_search_promotions
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailsearch.models import Query
|
||||
from wagtail.contrib.wagtailsearchpromotions.models import SearchPromotion
|
||||
from wagtail.contrib.wagtailsearchpromotions.templatetags.wagtailsearchpromotions_tags import get_search_promotions
|
||||
|
||||
|
||||
class TestSearchPromotions(TestCase):
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.shortcuts import get_object_or_404, redirect, render
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.vary import vary_on_headers
|
||||
|
||||
from wagtail.contrib.wagtailsearchpromotions import forms
|
||||
from wagtail.utils.pagination import paginate
|
||||
from wagtail.wagtailadmin import messages
|
||||
from wagtail.wagtailadmin.forms import SearchForm
|
||||
from wagtail.wagtailadmin.utils import any_permission_required, permission_required
|
||||
from wagtail.wagtailsearch import forms as search_forms
|
||||
from wagtail.wagtailsearch.models import Query
|
||||
from wagtail.wagtailadmin.forms import SearchForm
|
||||
from wagtail.wagtailadmin import messages
|
||||
from wagtail.wagtailadmin.utils import permission_required, any_permission_required
|
||||
|
||||
from wagtail.contrib.wagtailsearchpromotions import forms
|
||||
|
||||
|
||||
@any_permission_required(
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
from django.core import urlresolvers
|
||||
from django.conf.urls import include, url
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.core import urlresolvers
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.contrib.wagtailsearchpromotions import admin_urls
|
||||
|
||||
from wagtail.wagtailadmin.menu import MenuItem
|
||||
from wagtail.wagtailcore import hooks
|
||||
|
||||
|
||||
@hooks.register('register_admin_urls')
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from django.test import TestCase
|
||||
from django.core.cache import cache
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.tests.testapp.models import EventIndex, SimplePage
|
||||
from wagtail.wagtailcore.models import Page, PageViewRestriction, Site
|
||||
from wagtail.tests.testapp.models import SimplePage, EventIndex
|
||||
|
||||
from .sitemap_generator import Sitemap
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.http import HttpResponse
|
||||
from django.core.cache import cache
|
||||
from django.conf import settings
|
||||
from django.core.cache import cache
|
||||
from django.http import HttpResponse
|
||||
|
||||
from .sitemap_generator import Sitemap
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
from django import forms
|
||||
from django.core.paginator import Paginator
|
||||
from django.shortcuts import render
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.core.paginator import Paginator
|
||||
from wagtail.wagtailadmin import messages
|
||||
|
||||
from wagtail.wagtailadmin import messages
|
||||
from wagtail.wagtailadmin.forms import SearchForm
|
||||
from wagtail.wagtailadmin.widgets import AdminPageChooser, AdminDateInput, AdminTimeInput, AdminDateTimeInput
|
||||
from wagtail.wagtailimages.widgets import AdminImageChooser
|
||||
from wagtail.wagtailadmin.widgets import (
|
||||
AdminDateInput, AdminDateTimeInput, AdminPageChooser, AdminTimeInput)
|
||||
from wagtail.wagtaildocs.widgets import AdminDocumentChooser
|
||||
from wagtail.wagtailimages.widgets import AdminImageChooser
|
||||
|
||||
|
||||
class ExampleForm(forms.Form):
|
||||
|
|
|
@ -2,8 +2,8 @@ from django.conf.urls import url
|
|||
from django.core import urlresolvers
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailadmin.menu import MenuItem
|
||||
from wagtail.wagtailcore import hooks
|
||||
|
||||
from . import views
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from .base import *
|
||||
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from .base import *
|
||||
|
||||
|
||||
DEBUG = False
|
||||
|
||||
try:
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
from django.conf.urls import include, url
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.wagtailcore import urls as wagtail_urls
|
||||
|
||||
from search import views as search_views
|
||||
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtailcore import urls as wagtail_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^django-admin/', include(admin.site.urls)),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
|
||||
from django.shortcuts import render
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailsearch.models import Query
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import sys
|
||||
|
||||
from django.db import models
|
||||
|
||||
from django.contrib.auth.models import (
|
||||
Group, Permission, AbstractBaseUser, PermissionsMixin, BaseUserManager)
|
||||
AbstractBaseUser, BaseUserManager, Group, Permission, PermissionsMixin)
|
||||
from django.db import models
|
||||
|
||||
|
||||
class CustomUserManager(BaseUserManager):
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import django.db.models.deletion
|
||||
import modelcluster.contrib.taggit
|
||||
import wagtail.wagtailcore.fields
|
||||
import modelcluster.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
import wagtail.wagtailcore.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
from datetime import date
|
||||
|
||||
from django.db import models
|
||||
|
||||
from modelcluster.fields import ParentalKey
|
||||
from modelcluster.contrib.taggit import ClusterTaggableManager
|
||||
from modelcluster.fields import ParentalKey
|
||||
from taggit.models import TaggedItemBase
|
||||
|
||||
from wagtail.utils.pagination import paginate
|
||||
from wagtail.wagtailcore.models import Page, Orderable
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
FieldPanel, InlinePanel, MultiFieldPanel, PageChooserPanel)
|
||||
from wagtail.wagtailcore.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel, \
|
||||
InlinePanel, PageChooserPanel
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailcore.models import Orderable, Page
|
||||
from wagtail.wagtaildocs.edit_handlers import DocumentChooserPanel
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
# - Calling .path on the storage or image file raises NotImplementedError
|
||||
# - File.open() after the file has been closed raises an error
|
||||
|
||||
from django.core.files.storage import Storage, FileSystemStorage
|
||||
from django.core.files.base import File
|
||||
from django.core.files.storage import FileSystemStorage, Storage
|
||||
from django.utils.deconstruct import deconstructible
|
||||
|
||||
|
||||
|
|
|
@ -3,13 +3,12 @@ are rooted at '/site/' rather than '/'"""
|
|||
|
||||
from django.conf.urls import include, url
|
||||
|
||||
from wagtail.wagtailcore import urls as wagtail_urls
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtailcore import urls as wagtail_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.wagtailimages import urls as wagtailimages_urls
|
||||
from wagtail.wagtailsearch import urls as wagtailsearch_urls
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^admin/', include(wagtailadmin_urls)),
|
||||
url(r'^search/', include(wagtailsearch_urls)),
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
# Generated by Django 1.9.1 on 2016-02-12 10:55
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
import wagtail.contrib.wagtailroutablepage.models
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
# Generated by Django 1.9.1 on 2016-02-12 10:55
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import taggit.managers
|
||||
from django.db import migrations, models
|
||||
|
||||
import wagtail.wagtailsearch.index
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.db import models
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
from wagtail.wagtailsearch import index
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import os
|
||||
|
||||
|
||||
WAGTAIL_ROOT = os.path.dirname(__file__)
|
||||
STATIC_ROOT = os.path.join(WAGTAIL_ROOT, 'test-static')
|
||||
MEDIA_ROOT = os.path.join(WAGTAIL_ROOT, 'test-media')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
import wagtail.wagtailsearch.index
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import models
|
|||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
from wagtail.wagtailsnippets.models import register_snippet
|
||||
|
||||
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
# Generated by Django 1.9.1 on 2016-02-12 10:55
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import modelcluster.contrib.taggit
|
||||
import modelcluster.fields
|
||||
import taggit.managers
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
import wagtail.wagtailadmin.taggable
|
||||
import wagtail.wagtailcore.blocks
|
||||
import wagtail.wagtailcore.fields
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
# Generated by Django 1.9.1 on 2016-02-14 12:22
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
import wagtail.wagtailcore.models
|
||||
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Generated by Django 1.9.1 on 2016-03-01 21:32
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -3,39 +3,35 @@ from __future__ import unicode_literals
|
|||
import hashlib
|
||||
import os
|
||||
|
||||
from django.db import models
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
from taggit.models import TaggedItemBase
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from modelcluster.contrib.taggit import ClusterTaggableManager
|
||||
from modelcluster.fields import ParentalKey
|
||||
from modelcluster.models import ClusterableModel
|
||||
from modelcluster.contrib.taggit import ClusterTaggableManager
|
||||
from taggit.managers import TaggableManager
|
||||
from taggit.models import TaggedItemBase
|
||||
|
||||
from wagtail.contrib.settings.models import BaseSetting, register_setting
|
||||
from wagtail.wagtailcore.models import Page, Orderable, PageManager
|
||||
from wagtail.wagtailcore.fields import RichTextField, StreamField
|
||||
from wagtail.wagtailcore.blocks import CharBlock, RichTextBlock
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
FieldPanel, MultiFieldPanel, InlinePanel, PageChooserPanel, TabbedInterface, ObjectList
|
||||
)
|
||||
FieldPanel, InlinePanel, MultiFieldPanel, ObjectList, PageChooserPanel, TabbedInterface)
|
||||
from wagtail.wagtailadmin.forms import WagtailAdminPageForm
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailcore.blocks import CharBlock, RichTextBlock
|
||||
from wagtail.wagtailcore.fields import RichTextField, StreamField
|
||||
from wagtail.wagtailcore.models import Orderable, Page, PageManager
|
||||
from wagtail.wagtaildocs.edit_handlers import DocumentChooserPanel
|
||||
from wagtail.wagtailsnippets.models import register_snippet
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
|
||||
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
|
||||
from wagtail.wagtailsearch import index
|
||||
from wagtail.wagtailimages.models import AbstractImage, Image
|
||||
from wagtail.wagtailimages.blocks import ImageChooserBlock
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailimages.models import AbstractImage, Image
|
||||
from wagtail.wagtailsearch import index
|
||||
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
|
||||
from wagtail.wagtailsnippets.models import register_snippet
|
||||
|
||||
from .forms import ValidatedPageForm
|
||||
|
||||
|
||||
EVENT_AUDIENCE_CHOICES = (
|
||||
('public', "Public"),
|
||||
('private', "Private"),
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.conf.urls import url
|
||||
|
||||
from wagtail.tests.testapp.views import bob_only_zone
|
||||
|
||||
urlpatterns = [
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from django.http import HttpResponse
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailcore.whitelist import attribute_rule, check_url, allow_without_attributes
|
||||
from wagtail.wagtailadmin.menu import MenuItem
|
||||
from wagtail.wagtailadmin.search import SearchArea
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailcore.whitelist import allow_without_attributes, attribute_rule, check_url
|
||||
|
||||
|
||||
# Register one hook using decorators...
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
from django.conf.urls import include, url
|
||||
|
||||
from wagtail.wagtailcore import urls as wagtail_urls
|
||||
from wagtail.api.v2 import urls as wagtailapi2_urls
|
||||
from wagtail.contrib.wagtailapi import urls as wagtailapi_urls
|
||||
from wagtail.contrib.wagtailsitemaps.views import sitemap
|
||||
from wagtail.tests.testapp import urls as testapp_urls
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtailcore import urls as wagtail_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.wagtailimages import urls as wagtailimages_urls
|
||||
from wagtail.wagtailsearch import urls as wagtailsearch_urls
|
||||
from wagtail.contrib.wagtailsitemaps.views import sitemap
|
||||
from wagtail.contrib.wagtailapi import urls as wagtailapi_urls
|
||||
from wagtail.api.v2 import urls as wagtailapi2_urls
|
||||
|
||||
from wagtail.tests.testapp import urls as testapp_urls
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^admin/', include(wagtailadmin_urls)),
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.utils.functional import cached_property
|
||||
import functools
|
||||
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
|
||||
# Need to inherit from object explicitly, to turn ``cached_classmethod`` in to
|
||||
# a new-style class. WeakKeyDictionary is an old-style class, which do not
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
|
||||
|
||||
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
|
||||
|
||||
DEFAULT_PAGE_KEY = 'p'
|
||||
|
||||
|
|
|
@ -2,16 +2,18 @@
|
|||
# This is based on sendfiles builtin "simple" backend but uses a StreamingHttpResponse
|
||||
|
||||
import os
|
||||
import stat
|
||||
import re
|
||||
import stat
|
||||
from wsgiref.util import FileWrapper
|
||||
|
||||
from django.http import HttpResponseNotModified, StreamingHttpResponse
|
||||
from django.utils.http import http_date
|
||||
|
||||
try:
|
||||
from email.utils import parsedate_tz, mktime_tz
|
||||
except ImportError:
|
||||
from email.Utils import parsedate_tz, mktime_tz
|
||||
from wsgiref.util import FileWrapper
|
||||
|
||||
from django.http import StreamingHttpResponse, HttpResponseNotModified
|
||||
from django.utils.http import http_date
|
||||
|
||||
|
||||
def sendfile(request, filename, **kwargs):
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import os
|
||||
import io
|
||||
import subprocess
|
||||
import json
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from setuptools import Command
|
||||
from setuptools.command.bdist_egg import bdist_egg
|
||||
from setuptools.command.sdist import sdist as base_sdist
|
||||
|
||||
from wagtail.wagtailcore import __semver__
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import warnings
|
||||
|
||||
warnings.warn("wagtail.wagtailadmin.blocks has moved to wagtail.wagtailcore.blocks", UserWarning, stacklevel=2)
|
||||
|
||||
from wagtail.wagtailcore.blocks import * # noqa
|
||||
|
||||
warnings.warn("wagtail.wagtailadmin.blocks has moved to wagtail.wagtailcore.blocks", UserWarning, stacklevel=2)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.contrib.auth.views import \
|
||||
redirect_to_login as auth_redirect_to_login
|
||||
from django.contrib.auth.views import redirect_to_login as auth_redirect_to_login
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
|
@ -10,19 +10,17 @@ from django.utils.safestring import mark_safe
|
|||
from django.utils.six import text_type
|
||||
from django.utils.translation import ugettext_lazy
|
||||
|
||||
from wagtail.utils.decorators import cached_classmethod
|
||||
from wagtail.wagtailadmin import widgets
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailcore.utils import (
|
||||
camelcase_to_underscore, resolve_model_string)
|
||||
|
||||
from wagtail.utils.decorators import cached_classmethod
|
||||
from wagtail.wagtailcore.utils import camelcase_to_underscore, resolve_model_string
|
||||
|
||||
# DIRECT_FORM_FIELD_OVERRIDES, FORM_FIELD_OVERRIDES are imported for backwards
|
||||
# compatibility, as people are likely importing them from here and then
|
||||
# appending their own overrides
|
||||
from .forms import ( # NOQA
|
||||
DIRECT_FORM_FIELD_OVERRIDES, FORM_FIELD_OVERRIDES, WagtailAdminModelForm,
|
||||
WagtailAdminPageForm, formfield_for_dbfield)
|
||||
DIRECT_FORM_FIELD_OVERRIDES, FORM_FIELD_OVERRIDES, WagtailAdminModelForm, WagtailAdminPageForm,
|
||||
formfield_for_dbfield)
|
||||
|
||||
|
||||
def widget_with_script(widget, script):
|
||||
|
|
|
@ -19,7 +19,7 @@ from modelcluster.forms import ClusterForm, ClusterFormMetaclass
|
|||
from taggit.managers import TaggableManager
|
||||
|
||||
from wagtail.wagtailadmin import widgets
|
||||
from wagtail.wagtailcore.models import Page, Collection, GroupCollectionPermission
|
||||
from wagtail.wagtailcore.models import Collection, GroupCollectionPermission, Page
|
||||
|
||||
|
||||
class URLOrAbsolutePathValidator(validators.URLValidator):
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.forms import MediaDefiningClass, Media
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
from django.forms import Media, MediaDefiningClass
|
||||
from django.forms.utils import flatatt
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.text import slugify
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.six import text_type, with_metaclass
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
from django.utils.text import slugify
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.forms import MediaDefiningClass, Media
|
||||
from django.forms import Media, MediaDefiningClass
|
||||
from django.forms.utils import flatatt
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.text import slugify
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.six import text_type
|
||||
from django.utils.functional import cached_property, total_ordering
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.six import text_type, with_metaclass
|
||||
from django.utils.text import slugify
|
||||
|
||||
from django.utils.six import with_metaclass
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailadmin.forms import SearchForm
|
||||
from wagtail.wagtailcore import hooks
|
||||
|
||||
|
||||
@total_ordering
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from django.dispatch import Signal
|
||||
|
||||
|
||||
init_new_page = Signal(providing_args=['page', 'parent'])
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from taggit.models import Tag
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db.models import Count
|
||||
from taggit.models import Tag
|
||||
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django import template
|
||||
from django.conf import settings
|
||||
from django.contrib.humanize.templatetags.humanize import intcomma
|
||||
from django.template.defaultfilters import stringfilter
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailcore.models import get_navigation_menu_items, UserPagePermissionsProxy, PageViewRestriction
|
||||
from wagtail.wagtailcore.utils import camelcase_to_underscore, escape_script
|
||||
from wagtail.wagtailcore.utils import cautious_slugify as _cautious_slugify
|
||||
from wagtail.utils.pagination import DEFAULT_PAGE_KEY
|
||||
from wagtail.wagtailadmin.menu import admin_menu
|
||||
from wagtail.wagtailadmin.search import admin_search_areas
|
||||
|
||||
from wagtail.utils.pagination import DEFAULT_PAGE_KEY
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailcore.models import (
|
||||
PageViewRestriction, UserPagePermissionsProxy, get_navigation_menu_items)
|
||||
from wagtail.wagtailcore.utils import cautious_slugify as _cautious_slugify
|
||||
from wagtail.wagtailcore.utils import camelcase_to_underscore, escape_script
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
from django import template
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
from wagtail.wagtailcore.models import Page, PageRevision, PAGE_TEMPLATE_VAR
|
||||
from wagtail.wagtailadmin.userbar import (
|
||||
AddPageItem, AdminItem, ApproveModerationEditPageItem, EditPageItem, ExplorePageItem,
|
||||
RejectModerationEditPageItem)
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailcore.models import PAGE_TEMPLATE_VAR, Page, PageRevision
|
||||
|
||||
# from django.contrib.auth.decorators import permission_required
|
||||
|
||||
from wagtail.wagtailadmin.userbar import AdminItem, ExplorePageItem, EditPageItem, AddPageItem, \
|
||||
ApproveModerationEditPageItem, RejectModerationEditPageItem
|
||||
from wagtail.wagtailcore import hooks
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
from django.test import TestCase
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailcore.models import Collection
|
||||
|
|
|
@ -1,33 +1,23 @@
|
|||
import mock
|
||||
|
||||
from datetime import date
|
||||
|
||||
import mock
|
||||
from django import forms
|
||||
from django.core import checks
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
get_form_for_model,
|
||||
extract_panel_definitions_from_model_class,
|
||||
FieldPanel,
|
||||
RichTextFieldPanel,
|
||||
TabbedInterface,
|
||||
ObjectList,
|
||||
PageChooserPanel,
|
||||
InlinePanel,
|
||||
)
|
||||
|
||||
from wagtail.wagtailadmin.forms import WagtailAdminModelForm, WagtailAdminPageForm
|
||||
from wagtail.wagtailadmin.widgets import AdminPageChooser, AdminDateInput, AdminAutoHeightTextInput
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailcore.models import Page, Site
|
||||
from wagtail.wagtailcore.fields import RichTextArea
|
||||
from wagtail.tests.testapp.forms import ValidatedPageForm
|
||||
from wagtail.tests.testapp.models import (
|
||||
PageChooserModel, EventPageChooserModel, EventPage, EventPageSpeaker,
|
||||
SimplePage, ValidatedPage)
|
||||
EventPage, EventPageChooserModel, EventPageSpeaker, PageChooserModel, SimplePage, ValidatedPage)
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
FieldPanel, InlinePanel, ObjectList, PageChooserPanel, RichTextFieldPanel, TabbedInterface,
|
||||
extract_panel_definitions_from_model_class, get_form_for_model)
|
||||
from wagtail.wagtailadmin.forms import WagtailAdminModelForm, WagtailAdminPageForm
|
||||
from wagtail.wagtailadmin.widgets import AdminAutoHeightTextInput, AdminDateInput, AdminPageChooser
|
||||
from wagtail.wagtailcore.fields import RichTextArea
|
||||
from wagtail.wagtailcore.models import Page, Site
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
|
||||
|
||||
class TestGetFormForModel(TestCase):
|
||||
|
|
|
@ -5,7 +5,7 @@ from django.contrib.auth.models import AnonymousUser
|
|||
from django.template import engines
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.wagtailcore.models import Page, PAGE_TEMPLATE_VAR, Site
|
||||
from wagtail.wagtailcore.models import PAGE_TEMPLATE_VAR, Page, Site
|
||||
|
||||
|
||||
class TestCoreJinja(TestCase):
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.tests.testapp.models import SimplePage, EventPage, EventIndex
|
||||
from wagtail.tests.testapp.models import EventIndex, EventPage, SimplePage
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
|
||||
class TestChooserBrowse(TestCase, WagtailTestUtils):
|
||||
|
|
|
@ -1,26 +1,25 @@
|
|||
from datetime import datetime, timedelta
|
||||
import mock
|
||||
|
||||
import django
|
||||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
import mock
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import Group, Permission
|
||||
from django.core import mail, paginator
|
||||
from django.core.files.base import ContentFile
|
||||
from django.db.models.signals import pre_delete, post_delete
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.db.models.signals import post_delete, pre_delete
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
|
||||
from wagtail.tests.testapp.models import (
|
||||
SimplePage, FilePage, EventPage, EventPageCarouselItem,
|
||||
SingleEventPage, StandardIndex, StandardChild,
|
||||
BusinessIndex, BusinessChild, BusinessSubIndex,
|
||||
TaggedPage, Advert, AdvertPlacement)
|
||||
Advert, AdvertPlacement, BusinessChild, BusinessIndex, BusinessSubIndex, EventPage,
|
||||
EventPageCarouselItem, FilePage, SimplePage, SingleEventPage, StandardChild, StandardIndex,
|
||||
TaggedPage)
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailcore.models import GroupPagePermission, Page, PageRevision, Site
|
||||
from wagtail.wagtailcore.signals import page_published, page_unpublished
|
||||
from wagtail.wagtailusers.models import UserProfile
|
||||
from wagtail.wagtailsearch.index import SearchField
|
||||
from wagtail.wagtailusers.models import UserProfile
|
||||
|
||||
|
||||
def submittable_timestamp(timestamp):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.test import TestCase, override_settings
|
||||
from django.core import mail
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase, override_settings
|
||||
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.wagtailcore.models import Page, PageViewRestriction
|
||||
from wagtail.tests.testapp.models import SimplePage
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailcore.models import Page, PageViewRestriction
|
||||
|
||||
|
||||
class TestSetPrivacyView(TestCase, WagtailTestUtils):
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
from django.test import TestCase
|
||||
from django.test.client import RequestFactory
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.template import Template, Context
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.template import Context, Template
|
||||
from django.test import TestCase
|
||||
from django.test.client import RequestFactory
|
||||
|
||||
from wagtail.tests.testapp.models import BusinessChild, BusinessIndex
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailcore.models import Page, Site, PAGE_TEMPLATE_VAR
|
||||
from wagtail.tests.testapp.models import BusinessIndex, BusinessChild
|
||||
from wagtail.wagtailcore.models import PAGE_TEMPLATE_VAR, Page, Site
|
||||
|
||||
|
||||
class TestUserbarTag(TestCase):
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
from django.test import TestCase
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from wagtail.tests.testapp.models import EventPage, SimplePage
|
||||
from wagtail.wagtailadmin import widgets
|
||||
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.tests.testapp.models import SimplePage, EventPage
|
||||
|
||||
|
||||
class TestAdminPageChooserWidget(TestCase):
|
||||
|
|
|
@ -6,19 +6,17 @@ import json
|
|||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core import mail
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.core.urlresolvers import reverse, reverse_lazy
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from taggit.models import Tag
|
||||
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.wagtailadmin.menu import MenuItem
|
||||
from wagtail.wagtailadmin.site_summary import PagesSummaryItem
|
||||
from wagtail.wagtailadmin.utils import send_mail
|
||||
from wagtail.wagtailcore.models import Page, Site
|
||||
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from wagtail.wagtailadmin.menu import MenuItem
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
class TestHome(TestCase, WagtailTestUtils):
|
||||
def setUp(self):
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.conf.urls import url
|
||||
|
||||
from wagtail.wagtailadmin.views import collections
|
||||
|
||||
urlpatterns = [
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from django.conf.urls import url
|
||||
|
||||
from wagtail.wagtailadmin.views import pages, page_privacy
|
||||
|
||||
from wagtail.wagtailadmin.views import page_privacy, pages
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^add/(\w+)/(\w+)/(\d+)/$', pages.create, name='add'),
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.conf.urls import url
|
|||
from wagtail.wagtailadmin.forms import PasswordResetForm
|
||||
from wagtail.wagtailadmin.views import account
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^$', account.password_reset, {
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
from functools import wraps
|
||||
|
||||
from django.template.loader import render_to_string
|
||||
from django.core.mail import send_mail as django_send_mail
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.mail import send_mail as django_send_mail
|
||||
from django.db.models import Q
|
||||
from django.shortcuts import redirect
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from modelcluster.fields import ParentalKey
|
||||
|
||||
from wagtail.wagtailcore.models import Page, PageRevision, GroupPagePermission
|
||||
from wagtail.wagtailcore.models import GroupPagePermission, Page, PageRevision
|
||||
from wagtail.wagtailusers.models import UserProfile
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
from functools import wraps
|
||||
|
||||
from django.conf import settings
|
||||
from django.shortcuts import render, redirect
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.contrib.auth import update_session_auth_hash
|
||||
from django.contrib.auth.forms import SetPasswordForm
|
||||
from django.contrib.auth import update_session_auth_hash, views as auth_views
|
||||
from django.http import Http404
|
||||
from django.shortcuts import redirect, render
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
|
||||
from wagtail.wagtailadmin import forms
|
||||
from wagtail.wagtailcore.models import UserPagePermissionsProxy
|
||||
from wagtail.wagtailusers.forms import NotificationPreferencesForm
|
||||
from wagtail.wagtailusers.models import UserProfile
|
||||
from wagtail.wagtailcore.models import UserPagePermissionsProxy
|
||||
|
||||
|
||||
# Helper functions to check password management settings to enable/disable views as appropriate.
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
from django.shortcuts import get_object_or_404, render
|
||||
from django.http import Http404
|
||||
from django.shortcuts import get_object_or_404, render
|
||||
|
||||
from wagtail.utils.pagination import paginate
|
||||
from wagtail.wagtailadmin.modal_workflow import render_modal_workflow
|
||||
from wagtail.wagtailadmin.forms import (
|
||||
SearchForm, ExternalLinkChooserForm, ExternalLinkChooserWithLinkTextForm,
|
||||
EmailLinkChooserForm, EmailLinkChooserWithLinkTextForm)
|
||||
|
||||
EmailLinkChooserForm, EmailLinkChooserWithLinkTextForm, ExternalLinkChooserForm,
|
||||
ExternalLinkChooserWithLinkTextForm, SearchForm)
|
||||
from wagtail.wagtailadmin.modal_workflow import render_modal_workflow
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailcore.utils import resolve_model_string
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue