M docs/release_notes.rst => docs/release_notes.rst +1 -0
@@ 41,6 41,7 @@ Deprecated/Removed
* Django < 1.11 support is dropped :url-issue:`779`
* Python < 3.3 support is dropped :url-issue:`779` and :url-issue:`792`
* Deprecate ``wiki.urls.get_pattern`` and ``URL_CONFIG_CLASS`` setting :url-issue:`799`
+ * Removed ``SEARCH_VIEW`` setting, replaced by ``WikiSite`` override :url-issue:`837`
django-wiki 0.3.1
M src/wiki/conf/settings.py => src/wiki/conf/settings.py +0 -10
@@ 265,16 265,6 @@ URL_CONFIG_CLASS = getattr(
'WIKI_URL_CONFIG_CLASS',
None)
-#: Search view - dotted path denoting where the search view Class is located.
-SEARCH_VIEW = getattr(
- django_settings,
- 'WIKI_SEARCH_VIEW',
- 'wiki.views.article.SearchView'
- if not apps.is_installed('wiki.plugins.haystack')
- else
- 'wiki.plugins.haystack.views.HaystackSearchView'
-)
-
#: Seconds of timeout before renewing the article cache. Articles are automatically
#: renewed whenever an edit occurs but article content may be generated from
#: other objects that are changed.
M src/wiki/sites.py => src/wiki/sites.py +2 -3
@@ 1,6 1,7 @@
from django.apps import apps
from django.utils.functional import LazyObject
from django.utils.module_loading import import_string
+from wiki.conf import settings
from wiki.compat import include, url
from wiki.core.plugins import registry
@@ 17,7 18,6 @@ class WikiSite:
"""
def __init__(self, name='wiki'):
- from wiki.conf import settings
from wiki.views import accounts, article, deleted_list
self.name = name
@@ 43,7 43,7 @@ class WikiSite:
self.revision_merge_view = getattr(self, "revision_merge_view", article.MergeView.as_view())
self.revision_preview_merge_view = getattr(self, "revision_preview_merge_view", article.MergeView.as_view(preview=True))
- self.search_view = import_string(getattr(self, "search_view", settings.SEARCH_VIEW)).as_view()
+ self.search_view = getattr(self, "search_view", article.SearchView.as_view())
self.article_diff_view = getattr(self, "article_diff_view", article.DiffView.as_view())
# account views
@@ 89,7 89,6 @@ class WikiSite:
return urlpatterns
def get_accounts_urls(self):
- from wiki.conf import settings
if settings.ACCOUNT_HANDLING:
urlpatterns = [
url(r'^_accounts/sign-up/$', self.signup_view, name='signup'),
M src/wiki/urls.py => src/wiki/urls.py +3 -3
@@ 37,7 37,7 @@ class WikiURLPatterns:
revision_change_view_class = article.ChangeRevisionView
revision_merge_view_class = article.MergeView
- search_view_class = settings.SEARCH_VIEW
+ search_view_class = article.SearchView
article_diff_view_class = article.DiffView
# account views
@@ 75,7 75,7 @@ class WikiURLPatterns:
article.MissingRootView.as_view(),
name='root_missing'),
url(r'^_search/$',
- import_string(self.search_view_class).as_view(),
+ self.search_view_class.as_view(),
name='search'),
url(r'^_revision/diff/(?P<revision_id>[0-9]+)/$',
self.article_diff_view_class.as_view(),
@@ 201,7 201,7 @@ class WikiURLPatterns:
self.article_dir_view_class.as_view(),
name='dir'),
url(r'^(?P<path>.+/|)_search/$',
- import_string(self.search_view_class).as_view(),
+ self.search_view_class.as_view(),
name='search'),
url(r'^(?P<path>.+/|)_settings/$',
self.article_settings_view_class.as_view(),