I solved this.

It seems my models.py was wrong, I got a few FloatField without
max_digits and decimal_places set (it was coming from a 0.97pre
project).
On a remote Apache server I wasn't seeing the nice complaints that
normally Django dev-server shouts.


On 10 Ott, 18:48, Gio <[EMAIL PROTECTED]> wrote:
> I get this error:
> unsupported operand type(s) for +: 'NoneType' and 'int'
>
> referred to this snippet of code, debug informations are pointing to
> the line where the ChangeManipulator is:
> -------------------------------------------------
>     articolo = Articolo.objects.get(codice = c)
>     try:
>         manipulator = Articolo.ChangeManipulator(articolo.id)
>     except Articolo.DoesNotExist:
>         return HttpResponse('{success:false}')
> -------------------------------------------------
>
> Articolo, as defined in models.py
> -------------------------------------------------
> class Articolo(models.Model):
>     codice        = models.CharField(maxlength=255, unique=True)
>     descrizione   = models.CharField(maxlength=255)
>     immagine      = models.ImageField(upload_to='uploads')
>     brand         = models.ForeignKey(Brand)
>     stagione      = models.ForeignKey(Stagione)
>     prefisso      = models.ForeignKey(Prefisso)
>     colore        = models.ForeignKey(Colore)
>     costo_imposto = models.FloatField(null=True)
>     maggiorazione = models.IntegerField()
>
>     def __str__(self):
>         return self.codice
>
>     class Meta:
>         verbose_name_plural = 'articoli'
>         ordering = ['codice']
>
>     class Admin:
>         pass
>
>     def save(self):
>         size = 300, 100
>         try:
>             im = Image.open(self.get_immagine_filename())
>             im.thumbnail(size)
>             im.save(self.get_immagine_filename(), im.format)
>         except:
>             self.immagine = 'none.jpg'
>         super(Articolo, self).save()
>
>     def delete(self):
>         if self.immagine <> 'none.jpg':
>             remove(self.get_immagine_filename())
>         super(Articolo, self).delete()
> -------------------------------------------------
>
> Any idea?
> tnx


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to