mirror of
https://github.com/django/django.git
synced 2024-12-23 17:46:27 +00:00
19 lines
383 B
Python
19 lines
383 B
Python
from django import forms
|
|
from django.views.generic.edit import UpdateView
|
|
|
|
from .models import Article
|
|
|
|
|
|
class ArticleForm(forms.ModelForm):
|
|
content = forms.CharField(strip=False, widget=forms.Textarea)
|
|
|
|
class Meta:
|
|
model = Article
|
|
fields = '__all__'
|
|
|
|
|
|
class ArticleFormView(UpdateView):
|
|
model = Article
|
|
success_url = '/'
|
|
form_class = ArticleForm
|