I can't get my extended version of django.contrib.comments to take
notice of moderation.
If I use the standard comments framework, then my subclass of
CommentModerator does the job - I've just used it to define
enable_field, and this allows or prohibits comments as expected.
But if I switch to using my custom version of the comments framework
(which adds an extra field) it seems like the moderator is ignored -
all comments are allowed through, no matter whether the enable_field
on the commented-on object is true or false.
I can't see what I'm missing. Here's the code for my moderator, in
case it helps: http://dpaste.com/253308/ It works fine like that, with
the standard framework, but if I switch the import lines over, add my
custom comments app to INSTALLED_APPS and COMMENTS_APP settings, the
enable_field has no effect.
What's the magical missing step....? Thanks.
Phil
I've got a version of my custom comments framework, with
enable_comments moderation, working fine. Here are the contents of my
working customcomments/forms.py and customcomments/models.py:
http://dpaste.com/253382/
However, if I add "from weblog.models import Blog" to either of those
files, my custom moderation has no effect.
This is a problem, because what I really want to do is not add a
'title' field to each custom comment, but add a ForeignKey field that
links to the Blog object (comments are posted on Entries, each of
which is associated with a Blog). So I will need to import the Blog
class.
In case it helps, here's the contents of weblog/models.py that
contains the Blog class: http://dpaste.com/253384/
This modification really isn't worth the two days I've now spent
puzzling over it, but it's got personal, and I just want to understand
the solution now! Any help very much appreciated.
It works fine: comments can successfully be disabled on a per-Entry
basis. But, if you add "from weblog.models import Entry" to either
customcomments/forms.py or customcomments/models.py then comments are
*always* allowed through. Any idea why? Thanks.
I found what seems like a related ticket that's been opened and closed
a couple of times and tentatively re-opened it with an explanation:
http://code.djangoproject.com/ticket/12812
I'm going to have to move on though and try and work around the
problem for now as this frustration is doing me no good at all :(
Phil
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>