Skip to content

Commit

Permalink
Replaced obsolete syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Aug 11, 2020
1 parent 662f407 commit dd59450
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
6 changes: 3 additions & 3 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ view). The value is a URL that points to a view that fills a list of 2-tuples
Create the widget::

from django import forms
from django.core.urlresolvers import reverse
from django.urls import reverse
from tinymce.widgets import TinyMCE

class SomeForm(forms.Form):
Expand Down Expand Up @@ -189,9 +189,9 @@ the flatpages ``content`` field with a predefined list of other flatpages in
the link dialog you could use something like this::

from django import forms
from django.core.urlresolvers import reverse
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.urls import reverse
from tinymce.widgets import TinyMCE

class TinyMCEFlatPageAdmin(FlatPageAdmin):
Expand Down Expand Up @@ -238,7 +238,7 @@ provides a view and a template tag to make supporting this plugin easier. To
use it point the ``plugin_preview_pageurl`` configuration to the view named
``tinymce-preview``::

from django.core.urlresolvers import reverse
from django.urls import reverse
widget = TinyMCE(mce_attrs={'plugin_preview_pageurl': reverse('tinymce-preview', "NAME")})

The view named by ``tinymce-preview`` looks for a template named either
Expand Down
8 changes: 3 additions & 5 deletions testtinymce/urls.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import include, path

import tinymce.urls

admin.autodiscover()

urlpatterns = [
url(r"^tinymce/", include(tinymce.urls)),
url(r"^admin/", admin.site.urls),
path("tinymce/", include(tinymce.urls)),
path("admin/", admin.site.urls),
]

urlpatterns += staticfiles_urlpatterns()
10 changes: 5 additions & 5 deletions tinymce/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
from django.conf.urls import url
from django.urls import path

from tinymce import views

urlpatterns = [
url(r"^spellchecker/$", views.spell_check, name="tinymce-spellcheck"),
url(r"^flatpages_link_list/$", views.flatpages_link_list, name="tinymce-linklist"),
url(r"^compressor/$", views.compressor, name="tinymce-compressor"),
url(r"^filebrowser/$", views.filebrowser, name="tinymce-filebrowser"),
path("spellchecker/", views.spell_check, name="tinymce-spellcheck"),
path("flatpages_link_list/", views.flatpages_link_list, name="tinymce-linklist"),
path("compressor/", views.compressor, name="tinymce-compressor"),
path("filebrowser/", views.filebrowser, name="tinymce-filebrowser"),
]
2 changes: 1 addition & 1 deletion tinymce/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.shortcuts import render
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.decorators.csrf import csrf_exempt

from tinymce.compressor import gzip_compressor
Expand Down
9 changes: 2 additions & 7 deletions tinymce/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,14 @@
from django.conf import settings
from django.contrib.admin import widgets as admin_widgets
from django.forms.utils import flatatt
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.translation import get_language, ugettext as _
from django.utils.translation import get_language, gettext as _

import tinymce.settings

try:
from django.urls import reverse
except ImportError:
# Django < 1.10
from django.core.urlresolvers import reverse


class TinyMCE(forms.Textarea):
"""
Expand Down

0 comments on commit dd59450

Please sign in to comment.