- name = forms.CharField(widget=forms.HiddenInput)
- text = forms.CharField(widget=forms.Textarea)
- revision = forms.IntegerField(widget=forms.HiddenInput)
- comment = forms.CharField()
-
- def __init__(self, *args, **kwargs):
- document = kwargs.pop('instance', None)
- super(DocumentForm, self).__init__(*args, **kwargs)
- if document:
- self.fields['name'].initial = document.name
- self.fields['text'].initial = document.text
- self.fields['revision'].initial = document.revision()
-
- def save(self, document_author='anonymous'):
- storage = getstorage()