diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-05 18:30:24 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-05 18:31:52 +0200 | 
| commit | f751e22887e8940d0e3ed3c81eee0fb92e8d7820 (patch) | |
| tree | 54a97773eef1b633895480a8b8caeb768bf7b43a /archaeological_operations/forms.py | |
| parent | 10c8a694f2ffcfc001f5deddcb7d633d9f00b7cc (diff) | |
| download | Ishtar-f751e22887e8940d0e3ed3c81eee0fb92e8d7820.tar.bz2 Ishtar-f751e22887e8940d0e3ed3c81eee0fb92e8d7820.zip | |
Add images for operation, context records and sources (refs #2927, refs #351)
Diffstat (limited to 'archaeological_operations/forms.py')
| -rw-r--r-- | archaeological_operations/forms.py | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 247dcc20a..7bac80b48 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -714,6 +714,7 @@ class DashboardForm(forms.Form):  class OperationFormGeneral(ManageOldType, forms.Form):      form_label = _(u"General")      base_model = 'archaeological_site' +    file_upload = True      associated_models = {'scientist': Person,                           'in_charge': Person,                           'cira_rapporteur': Person, @@ -802,6 +803,13 @@ class OperationFormGeneral(ManageOldType, forms.Form):                                         required=False)      virtual_operation = forms.BooleanField(required=False,                                             label=_(u"Virtual operation")) +    image = forms.ImageField( +        label=_(u"Image"), help_text=mark_safe( +            _(u"<p>Heavy images are resized to: %(width)dx%(height)d " +              u"(ratio is preserved).</p>") % { +                'width': settings.IMAGE_MAX_SIZE[0], +                'height': settings.IMAGE_MAX_SIZE[1]}), +        required=False, widget=widgets.ImageFileInput())      def __init__(self, *args, **kwargs):          super(OperationFormGeneral, self).__init__(*args, **kwargs) | 
