| 65 | | content = forms.CharField( |
| 66 | | widget=forms.Textarea(attrs={'rows': '15'}), |
| | 64 | new_tags = ListCharField( # New field, (no field from BlogEntry model) |
| | 65 | max_length=255, required=False, |
| | 66 | help_text=_( |
| | 67 | "New tags for this entry, if there not in the list above" |
| | 68 | " (separated by spaces.)" |
| | 69 | ), |
| | 70 | widget=forms.TextInput(attrs={'class':'bigger'}), |
| 69 | | tags = forms.CharField( |
| 70 | | max_length=255, required=False, |
| 71 | | help_text=_("Tags for this entry (separated by spaces.)"), |
| 72 | | widget=forms.TextInput(attrs={'class':'bigger'}), |
| 73 | | ) |
| | 73 | def __init__(self, *args, **kwargs): |
| | 74 | """ |
| | 75 | set some widget attributes |
| | 76 | """ |
| | 77 | super(BlogEntryForm, self).__init__(*args, **kwargs) |
| | 78 | |
| | 79 | # Limit the MultipleChoiceField size |
| | 80 | # Is there are a better way to do this? See: |
| | 81 | # http://www.python-forum.de/topic-15503.html (de) |
| | 82 | self.fields['tags'].widget.attrs["size"] = 7 |
| | 83 | |
| | 84 | # makes the content textarea bigger |
| | 85 | self.fields['content'].widget.attrs["rows"] = 15 |
| | 86 | |