Phil,

A quick reply so I may be wrong on the details.
I think you're running into a limitation on the standard way of doing
things in Django.

I've talked about this before here:
http://groups.google.com/group/django-users/browse_thread/thread/22875fd287d0aa81/d6cf04a857424678?show_docid=d6cf04a857424678

and here:
http://groups.google.com/group/django-developers/browse_thread/thread/363fc7f3ca107f94/25a85be6cce875ed?hide_quotes=no

no time for a full reply here but if it's gotten personal this might
help you a bit,

Klaas

On Oct 5, 4:36 pm, Phil Gyford <gyf...@gmail.com> wrote:
> I've made as minimal a complete demonstration of this as possible, to
> try and work out where I'm going 
> wrong:http://github.com/philgyford/django-commentstest/
>
> 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.
>
>
>
>
>
>
>
>
>
> On Tue, Oct 5, 2010 at 2:46 PM, Phil Gyford <gyf...@gmail.com> wrote:
> > I've investigated further and... it's very strange.
>
> > 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.
>
> > On Tue, Oct 5, 2010 at 11:27 AM, Phil Gyford <gyf...@gmail.com> wrote:
> >> Hi,
>
> >> 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
>
> >> --
> >>http://www.gyford.com/
>
> > --
> >http://www.gyford.com/
>
> --http://www.gyford.com/

-- 
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.

Reply via email to