Closed amyth closed 10 years ago
You dont have to set
public = ModerationObjectsManager()
and
manager_names = ['public']
Remove it and it should be ok.
manager_names should be used when you want to enable moderation on different managers then objects
You can also set model as
class SomeModel(models.Model):
objects = models.Manager()
public = models.Manager()
class SomeModelModerator(GenericModerator): """ Represents a moderator object. """
notify_user = False
auto_approve_for_superusers = True
auto_approve_for_staff = True
@dominno Thanks for your quick response. Yes, it does work, Though, the unmoderated_
I went through the documentation and am trying to use
django-moderation
with one of my applications but not able to get it to work.I have registered the model with moderator as follows.
Have the following managers defined in the model:
Am also using admin so I have inherited the admin from
ModerationAdmin
In one of the methods I want to get access to all the objects irrespective of if it has been approved or not i.e. I want to bypass moderation.
Documentation states:
But there is no attribute named
unmoderated_objects
available on theSomeModel
.Moreover, from what I understand, if I use
manager_names
in the moderator object only the specified manager_names should be overridden in which case I should actually be able to access all the objects usingSomeModel.objects
and moderated objects while usingSomeModel.public
but that is not the case. Both the managers are being overridden for some reason.Is there something I am doing wrong ? Howcome the
unmoderated_objects
manager is not available on my model ?