diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-09-12 15:07:35 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-09-12 15:07:35 +0200 |
commit | bcf57a6741430bd81c36c6b37d3ad99cf195c72a (patch) | |
tree | d8935c1daeec06c6809b41d99a05a290ee3a2fd8 /chimere/forms.py | |
parent | c0f6bb0bd4ca0b90ab06a49cb0f1618be3f4cc00 (diff) | |
download | Chimère-bcf57a6741430bd81c36c6b37d3ad99cf195c72a.tar.bz2 Chimère-bcf57a6741430bd81c36c6b37d3ad99cf195c72a.zip |
Simplify multimedia and picture forms
Diffstat (limited to 'chimere/forms.py')
-rw-r--r-- | chimere/forms.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/chimere/forms.py b/chimere/forms.py index fe0dc9c..b484118 100644 --- a/chimere/forms.py +++ b/chimere/forms.py @@ -687,14 +687,7 @@ class MultimediaFileForm(BaseFileForm): class Meta: model = MultimediaFile - exclude = ('order',) - - def __init__(self, *args, **kwargs): - super(MultimediaFileForm, self).__init__(*args, **kwargs) - self.fields['multimedia_type'].widget.choices = \ - MultimediaType.get_tuples() - # this can be auto detect - self.fields['multimedia_type'].required = False + exclude = ('order', 'miniature', 'multimedia_type') MultimediaFileFormSet = formset_factory(MultimediaFileForm, can_delete=True) @@ -720,7 +713,7 @@ class PictureFileForm(BaseFileForm): class Meta: model = PictureFile exclude = ('order', 'height', 'width', 'thumbnailfile', - 'thumbnailfile_height', 'thumbnailfile_width') + 'thumbnailfile_height', 'thumbnailfile_width', 'miniature') PictureFileFormSet = formset_factory(PictureFileForm, can_delete=True) |