summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
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
commit7fb1ff25e2491e94c3446a401e644de9793006f5 (patch)
tree54a97773eef1b633895480a8b8caeb768bf7b43a /archaeological_operations/forms.py
parentd3d84ed7cc5ff3cb9c164838c78cfcee73fbc44e (diff)
downloadIshtar-7fb1ff25e2491e94c3446a401e644de9793006f5.tar.bz2
Ishtar-7fb1ff25e2491e94c3446a401e644de9793006f5.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.py8
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)