Add new version upload option to use new file filename as the document filename

This commit is contained in:
Roberto Rosario
2011-12-04 03:21:34 -04:00
parent a4127f39ff
commit 071fed8996
3 changed files with 79 additions and 63 deletions

View File

@@ -156,6 +156,13 @@ class DocumentForm(forms.ModelForm):
# To allow merging with DocumentForm_edit
self.fields['document_type'].widget = forms.HiddenInput()
if instance:
self.fields['use_file_name'] = forms.BooleanField(
label=_(u'Use the new version filename as the document filename'),
initial=False,
required=False,
)
# Instance's document_type overrides the passed document_type
if instance:
if hasattr(instance, 'document_type'):