diff options
Diffstat (limited to 'archaeological_warehouse/forms.py')
| -rw-r--r-- | archaeological_warehouse/forms.py | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index fba848748..65c11b086 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -20,6 +20,7 @@  from django import forms  from django.conf import settings  from django.forms.formsets import formset_factory +from django.utils.safestring import mark_safe  from django.utils.translation import ugettext_lazy as _  from ishtar_common.models import Person, valid_id @@ -148,6 +149,7 @@ class WarehouseDeletionForm(FinalForm):  class ContainerForm(ManageOldType, forms.Form):      form_label = _(u"Container") +    file_upload = True      associated_models = {'container_type': models.ContainerType,                           'location': models.Warehouse,                           'responsible': models.Warehouse} @@ -165,6 +167,13 @@ class ContainerForm(ManageOldType, forms.Form):              reverse_lazy('autocomplete-warehouse'),              associated_model=models.Warehouse, new=True),          validators=[valid_id(models.Warehouse)]) +    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]}), +        max_length=255, required=False, widget=widgets.ImageFileInput())      comment = forms.CharField(label=_(u"Comment"),                                widget=forms.Textarea, required=False)  | 
