- 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()