dominno / django-moderation

django-moderation is reusable application for Django framework, that allows to moderate any model objects.
BSD 3-Clause "New" or "Revised" License
269 stars 90 forks source link

moderation_status value in template #39

Closed ouhouhsami closed 13 years ago

ouhouhsami commented 13 years ago

Hello there,

I would like to access moderation_status in template directly from the instance object moderated. I would have to use something like

How can I achieve this, without having to add boolean field for a visibility_column (moreover,

)

Thanks,

treyhunner commented 13 years ago

From an instance of an object my_obj that is registered with moderation, my_obj.moderated_object should return the ModeratedObject instance. So this should work: my_obj.moderated_object.moderation_status

ouhouhsami commented 13 years ago

great, this could be added to the doc ;)

ouhouhsami commented 12 years ago

and for those who want to access changed values in templates, they can achieve this by doing : my_obj.moderated_object.changed_object.FIELD_NAME