On 21/10/10 08:22, shacker wrote: > Thanks David, but I'm not sure I'm getting this. I've added that line > to the class, but it doesn't give me cascade delete behavior (I can > still delete a row and the comments linked to it remain in the db). Is > there something else I need to do?
Hmm. Appears to work okay for me (only tested Django-1.1.2), at least for instance.delete(). Perhaps you could try the operation directly at ./manage.py shell to see if there's anything odd going on: e.g. > from django.contrib.sites.models import Site > s = Site.objects.get_current() > from myapp.models import MyModel > m = MyModel(name="foo") # or whatever, with the reverse generic rel. > m.save() > from django.contrib.comments.models import Comment > c = Comment(site=s, content_object=m, comment="Hello") > c.save() > Comment.objects.all() [..., <Comment: : Blah...>, <Comment: : Hello...>] > m.delete() > Comment.objects.all() [..., <Comment: : Blah...>] # Hello is gone... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.