diff options
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r-- | archaeological_finds/forms.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 367bff023..efb827ef4 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -29,6 +29,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.db.models import Max from django.shortcuts import render_to_response from django.template import RequestContext +from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from ishtar_common.models import Person, valid_id, valid_ids @@ -45,6 +46,7 @@ from ishtar_common.forms_common import get_town_field, \ from archaeological_context_records.forms import RecordFormSelection class FindForm(forms.Form): + file_upload = True form_label = _("Find") base_model = 'base_finds' associated_models = {'material_type':models.MaterialType,} @@ -58,6 +60,12 @@ class FindForm(forms.Form): volume = FloatField(label=_(u"Volume (l)"), required=False) weight = FloatField(label=_(u"Weight (g)"), required=False) find_number = forms.IntegerField(label=_(u"Find number"), required=False) + 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) def __init__(self, *args, **kwargs): super(FindForm, self).__init__(*args, **kwargs) |