Hi Patrick, > [code]class Foto(models.Model): > titolo = models.CharField(_('Titolo'), max_length=20, null=True, > blank=True) > autore = models.ForeignKey(User) > originale = models.ImageField(_('Foto originale'), > upload_to='media/upload/bisaccia/originali') > foto = models.ImageField(_('Foto'), upload_to='media/upload/ > bisaccia/', editable=False) > data = models.DateTimeField(_('Data Aggiunta'), auto_now=True) > descrizione = models.TextField(_('Descrizione')) > categoria = models.ForeignKey(CategoriaGenerica) > luogo = models.ForeignKey(LuogoGenerico, null=True, blank=True) > > def save(self): > from PIL import Image > if not self.foto: > > dimensioni = (400, 300) > > self.save_foto_file(self.originale.name, '')
That second parameter can't be a string...it needs to be a File object of the type django.core.files.File. Try this instead: from django.core.files.base import ContentFile self.save_foto_file(self.originale.name, ContentFile('')) -Rajesh D --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---