Re: image uploading, validation by using form

2008-12-21 Thread Chuck22
Before I can write validation of uploaded images, I first need to know how to save multiple upload images in view. Can anyone share some code or reference on this? Thanks. On Dec 20, 10:31 pm, Brandon Taylor wrote: > Hi, > > You can do validation on images by using a custom form for your admin >

Re: image uploading, validation by using form

2008-12-20 Thread Brandon Taylor
Hi, You can do validation on images by using a custom form for your admin Model. This example validates that a thumbnail image is a specific dimension, file type and file size, from django.core.files.images import get_image_dimensions class MyModelAdminForm(forms.ModelForm): model = MyModel

image uploading, validation by using form

2008-12-20 Thread Chuck22
Here is my model: class Book(models.Model): title = models.CharField(max_length=150) category = models.CharField(max_length=50) description = models.CharField(max_length=2000) image1 = models.ImageField(upload_to='img/bk', blank=True) image2 = models.ImageField(upload_to='img/