-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforms.py
24 lines (18 loc) · 826 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from fblog.models import Entry
class EntryAdminForm(forms.ModelForm):
#content = forms.CharField() # override widget
class Meta:
model = Entry
exclude = ('author')
def __init__(self, *args, **kwargs):
super(EntryAdminForm, self).__init__(*args, **kwargs)
self.fields['category'].widget.attrs['style'] = 'width: 98%'
self.fields['title'].widget.attrs['style'] = 'width: 98%'
self.fields['slug'].widget.attrs['style'] = 'width: 98%'
self.fields['content'].widget.attrs['cols'] = 80
self.fields['content'].widget.attrs['rows'] = 16
self.fields['content'].widget.attrs['style'] = 'width: 98%'
self.fields['related_entries'].widget.attrs['style'] = 'width: 98%'