Виджет Summernote не отображается при наследовании от UpdateView
urls.py
path('post/<int:pk>/update/', PostUpdateView.as_view(), name='post-update'),
views.py:
class PostUpdateView(LoginRequiredMixin, UserPassesTestMixin, UpdateView):
model = PostForNewsFeed
fields = ['post','title','content', 'tags','visibility']
template_name = 'feed/create_post.html'
widgets = {
'content': SummernoteWidget(),
}
def form_valid(self, form):
if form.is_valid():
data = form.save(commit=False)
data.user_name = self.request.user
data.save()
messages.success(self.request, f'Posted Successfully')
return redirect('home2')
def test_func(self):
post = self.get_object()
if self.request.user == post.user_name:
return True
return False
@python_2_unicode_compatible
class PostForNewsFeed(models.Model):
post = models.CharField(max_length=50, choices=POSTTYPE_CHOICES, default='Just a Mesage')
#fullname = models.CharField(max_length=50, blank=True, null=True, default=None)
title = models.CharField(max_length=100, blank=False, null=False)
content = models.TextField(default=None)
Виджет летних заметок не отрисовывается на PostupdateView