Hello django users 

I solved the issue, I had to use something like that : (it doesn't show 
anymore the error)

@receiver(post_save, sender=mail_items)
def update_count(sender, instance, created, **kwargs):
    count_object,created = 
mail_item_count.objects.get_or_create(country=instance.Pays_origine) 
    if not created:
        count_object.count = count_object.count + 1
        count_object.save()

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f9d7d6c9-5940-4dac-8ff0-137f621fc4c1%40googlegroups.com.

Reply via email to