diff --git a/example/blog/articles/forms.py b/example/blog/articles/forms.py index e7d5173..b22dfc2 100644 --- a/example/blog/articles/forms.py +++ b/example/blog/articles/forms.py @@ -26,7 +26,7 @@ class Meta: class ArticleForm(forms.ModelForm): class Meta: model = Article - fields = ['title', 'text'] + fields = ["title", "text"] widgets = { "text": CKEditor5Widget( attrs={"class": "django_ckeditor_5"}, diff --git a/example/blog/articles/urls.py b/example/blog/articles/urls.py index 7322663..d64d45b 100644 --- a/example/blog/articles/urls.py +++ b/example/blog/articles/urls.py @@ -1,8 +1,6 @@ from django.urls import path -from .views import ( - ArticleDetailView, ArticleListView, ArticleCreateView, GetEditorView -) +from .views import ArticleDetailView, ArticleListView, ArticleCreateView, GetEditorView urlpatterns = [ path("", ArticleListView.as_view(), name="article-list"), diff --git a/example/blog/articles/views.py b/example/blog/articles/views.py index 838d37e..719c161 100644 --- a/example/blog/articles/views.py +++ b/example/blog/articles/views.py @@ -13,9 +13,7 @@ class ArticleListView(ListView): model = Article paginate_by = 100 - extra_context = { - 'media': CommentForm().media - } + extra_context = {"media": CommentForm().media} class ArticleDetailView(DetailView, FormView): @@ -41,18 +39,16 @@ def post(self, request, *args, **kwargs): class ArticleCreateView(CreateView): - """ Article create view """ + """Article create view""" model = Article form_class = ArticleForm template_name = "articles/article_create.html" def get_success_url(self): - return reverse('article-list') + return reverse("article-list") class GetEditorView(TemplateView): - template_name = 'articles/dynamic_editor.html' - extra_context = { - 'form': ArticleForm() - } + template_name = "articles/dynamic_editor.html" + extra_context = {"form": ArticleForm()}