Closed ouhouhsami closed 13 years ago
Some possible workarounds for this:
visibility_column
and default the column to True
so objects are initially visible.manager_names
and remove objects
so ModeratedObjectsManager
does not replace the default managerYou'll probably also want to use BaseModeratedObjectForm
to show the original version of the object to the user.
Each manager that is registered with moderation has unmoderated version of this manager under name "unmoderated_MANAGER_NAME", ex. MyModel.unmoderated_objects.all()
So you can do something like this:
if user.is_staff:
MyModel.unmoderated_objects.all()
else:
MyModel.objects.all()
thx dominno and treyhunner for your answers. I think the easiest way for me to deal with my problem is to use unmoderated_objects.
Maybe there is a way to achieve this, but I didn't find a solution: User via UserProfile create instance of a Model A, when they save, I'm not able to show to them (and only them) the instance they have just created (because it's not moderated yet), or even, allow them to modify their submission.
For instance : one user create model A instance, I would like him to be able to re-edit is datas, and to have a sort of preview of what he has just done, not getting a 'instance does'nt exist' for my user only. (is that clear ?, may be a decorator could do this for the 'owner' of the instance created ?)
thx