#11917: Generic comment moderation fails on ./manage.py shell with AlreadyModerated -------------------------------------+-------------------------------------- Reporter: fractal | Owner: nobody Status: new | Milestone: Component: django.contrib.comments | Version: 1.1 Keywords: AlreadyModerated | Stage: Unreviewed Has_patch: 0 | -------------------------------------+-------------------------------------- when you register a model to be moderated you are unable o import that models.py on the shell
how to reproduce create a project and a app inside it set a model and a Comment moderator as per http://docs.djangoproject.com/en/dev/ref/contrib/comments/moderation/ instructions {{{ #foo/bar/models.py from django.db import models class Entry(models.Model): pass from django.contrib.comments.moderation import CommentModerator, moderator class EntryModerator(CommentModerator): pass moderator.register(Entry, EntryModerator) }}} save and open the shell {{{ ./manage shell In [1]: from bar.models import * --------------------------------------------------------------------------- AlreadyModerated Traceback (most recent call last) /tmp/foo/<ipython console> in <module>() /tmp/foo/bar/models.py in <module>() 9 10 class EntryModerator(CommentModerator): 11 pass 12 ---> 13 moderator.register(Entry, EntryModerator) /usr/local/lib/python2.6/dist- packages/django/contrib/comments/moderation.pyc in register(self, model_or_iterable, moderation_class) 301 for model in model_or_iterable: 302 if model in self._registry: --> 303 raise AlreadyModerated("The model '%s' is already being moderated" % model._meta.module_name) 304 self._registry[model] = moderation_class(model) 305 AlreadyModerated: The model 'entry' is already being moderated }}} -- Ticket URL: <http://code.djangoproject.com/ticket/11917> 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 django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---