From 018e43e908e912b5e99dcc648b37a68ee59a58ed Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Fri, 29 Sep 2017 10:42:24 -0400 Subject: [PATCH 1/3] Remove old django-filter templates (#5465) --- .../templates/rest_framework/filters/django_filter.html | 6 ------ .../rest_framework/filters/django_filter_crispyforms.html | 5 ----- 2 files changed, 11 deletions(-) delete mode 100644 rest_framework/templates/rest_framework/filters/django_filter.html delete mode 100644 rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html diff --git a/rest_framework/templates/rest_framework/filters/django_filter.html b/rest_framework/templates/rest_framework/filters/django_filter.html deleted file mode 100644 index b116e3531..000000000 --- a/rest_framework/templates/rest_framework/filters/django_filter.html +++ /dev/null @@ -1,6 +0,0 @@ -{% load i18n %} -

{% trans "Field filters" %}

-
- {{ filter.form.as_p }} - -
diff --git a/rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html b/rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html deleted file mode 100644 index 171767c08..000000000 --- a/rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html +++ /dev/null @@ -1,5 +0,0 @@ -{% load crispy_forms_tags %} -{% load i18n %} - -

{% trans "Field filters" %}

-{% crispy filter.form %} From efc427dfc8144855f28a20888bbe11b83cbfa08f Mon Sep 17 00:00:00 2001 From: Matteo Nastasi Date: Mon, 2 Oct 2017 08:59:53 +0200 Subject: [PATCH 2/3] Reuse 'apply_markdown' function in 'render_markdown' templatetag func (#5469) * reused 'apply_markdown' function in 'render_markdown' templatetag function * typo fixed --- rest_framework/templatetags/rest_framework.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rest_framework/templatetags/rest_framework.py b/rest_framework/templatetags/rest_framework.py index a2ee5ccdd..264b6444c 100644 --- a/rest_framework/templatetags/rest_framework.py +++ b/rest_framework/templatetags/rest_framework.py @@ -11,7 +11,8 @@ from django.utils.html import escape, format_html, smart_urlquote from django.utils.safestring import SafeData, mark_safe from rest_framework.compat import ( - NoReverseMatch, markdown, pygments_highlight, reverse, template_render + NoReverseMatch, apply_markdown, pygments_highlight, reverse, + template_render ) from rest_framework.renderers import HTMLFormRenderer from rest_framework.utils.urls import replace_query_param @@ -68,9 +69,9 @@ def form_for_link(link): @register.simple_tag def render_markdown(markdown_text): - if not markdown: + if apply_markdown is None: return markdown_text - return mark_safe(markdown.markdown(markdown_text)) + return mark_safe(apply_markdown(markdown_text)) @register.simple_tag From e6193cfd9e6391c635368b9c71ed545c8fc024d1 Mon Sep 17 00:00:00 2001 From: Shreyans Sheth Date: Mon, 2 Oct 2017 12:34:55 +0530 Subject: [PATCH 3/3] Added Response import in Code Snippet (#5468) Added `from rest_framework.response import Response` in the viewset code snippet example --- docs/tutorial/6-viewsets-and-routers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorial/6-viewsets-and-routers.md b/docs/tutorial/6-viewsets-and-routers.md index 6189c7771..252021e39 100644 --- a/docs/tutorial/6-viewsets-and-routers.md +++ b/docs/tutorial/6-viewsets-and-routers.md @@ -26,6 +26,7 @@ Here we've used the `ReadOnlyModelViewSet` class to automatically provide the de Next we're going to replace the `SnippetList`, `SnippetDetail` and `SnippetHighlight` view classes. We can remove the three views, and again replace them with a single class. from rest_framework.decorators import detail_route + from rest_framework.response import Response class SnippetViewSet(viewsets.ModelViewSet): """