#12812: Inheriting from comments breaks comment moderation
---------------------------------------------+------------------------------
 Reporter:  Beetle_B                         |       Owner:  nobody    
   Status:  new                              |   Milestone:            
Component:  django.contrib.comments          |     Version:  1.1       
 Keywords:  comments inheritance moderation  |       Stage:  Unreviewed
Has_patch:  0                                |  
---------------------------------------------+------------------------------
 I created a new kind of comment called TreeComment which (ultimately)
 subclasses Comment (in contrib.comments)

 Essentially, I have a TreeCommentBase which subclasses Comment and is an
 abstract class. Then TreeComment subclasses TreeCommentBase. This is all
 in a custom app called treecomments.

 Now in the moderation code, we have:

 {{{
         signals.comment_will_be_posted.connect(self.pre_save_moderation,
 sender=comments.get_model())
         signals.comment_was_posted.connect(self.post_save_moderation,
 sender=comments.get_model())
 }}}

 which relies on get_model() which is defined in the __init__.py file in
 comments. This causes a wrong model to be sent (my model is TreeComment,
 not Comment).

 If I replace it with treecomments.get_model() (and create that function
 under __init__.py - I needed it for something else anyway), then it all
 works.

 Am I doing something wrong? Is there a more proper way of subclassing? For
 now I'll just subclass Moderator and customize to fix this...

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12812>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to