I have 2 models

class Article(models.Model):

    active = models.BooleanField(default=False, db_index=True)

    title = models.CharField(max_length=150)

class ArticleGallery(models.Model):

    article = models.ForeignKey(Article)

    image = 
models.ImageField(upload_to=settings.ARTICLE_GALLERY_IMG_UPLOAD_TO)

    

    def delete(self, *args, **kwargs):

        self.image.delete()

        super(ArticleGallery, self).delete(*args, **kwargs)


But when i click delete in Article and submit it, elements are removed from 
database but ArticleGallery.delete() isn't fired up.
I need the delete method to be run when deleting Article. Any clues?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TIPI-hi3_d0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to