Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
hvlads committed Mar 2, 2024
1 parent 5c32be1 commit c7936ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion example/blog/articles/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
4 changes: 1 addition & 3 deletions example/blog/articles/urls.py
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
14 changes: 5 additions & 9 deletions example/blog/articles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()}

0 comments on commit c7936ee

Please sign in to comment.