summaryrefslogtreecommitdiff
path: root/root/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'root/forms.py')
-rw-r--r--root/forms.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/root/forms.py b/root/forms.py
new file mode 100644
index 0000000..9c00925
--- /dev/null
+++ b/root/forms.py
@@ -0,0 +1,15 @@
+from django.forms import ModelForm
+
+from .models import Page
+
+
+class PageForm(ModelForm):
+ class Meta:
+ model = Page
+ fields = ['name', 'title', 'subtitle', 'header_image', 'body']
+ exclude = ['edited']
+
+ def __init__(self, *args, **kwargs):
+ super(PageForm, self).__init__(*args, **kwargs)
+ self.fields['body'].widget.attrs['cols'] = 60
+ self.fields['body'].widget.attrs['rows'] = 25 \ No newline at end of file