1. Related objects are deleted automatically 2. post_delete signal sends when object already is deleted. so it has no primary key(id=None)
On 11 окт, 17:33, "Young Gyu Park" <[EMAIL PROTECTED]> wrote: > > def delete_comment_by_entry(sender, instance, signal, *args, **kwargs): > > entry = instance.id > > try: > > FreeComment.objects.filter > > (object_id__exact=instance._get_pk_val()).delete() > > except (FreeComment.DoesNotExist, AssertionError): > > logger.info('free comment post delete : ' + entry) > > logger.info('free comment post delete : ' + entry.id ) > > > # connect signal > > dispatcher.connect(delete_comment_by_entry, sender=Entry, signal= > > signals.post_delete) > > I have been making the blog system. > > When I deleted the entry, I want to delete the comments in conjunction with > entry automatically. > > So I try to use the signal but this is not working > > but It is not working I don't know why > > can you let me know a way? > > Thanks a lot always. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---