django-cms / djangocms-moderation

Other
13 stars 20 forks source link

Add docs for publish signal #163

Closed jonathan-s closed 4 years ago

jonathan-s commented 4 years ago

Docs as promised in #159

Aiky30 commented 4 years ago

Can we add an example usage in the docs like in versioning? Makes it much easier for anyone using the signal: https://github.com/divio/djangocms-versioning/blob/master/docs/signals.rst

jonathan-s commented 4 years ago

@Aiky30 I've added an example as well.

jonathan-s commented 4 years ago

I’ve updated the documentation to add a separate signal for called unpublished.

This signal is added in the pr where the rest of the unpublished flow exists

On Mon 21. Oct 2019 at 13:34, Aiky30 notifications@github.com wrote:

@Aiky30 commented on this pull request.

In docs/signals.rst https://github.com/divio/djangocms-moderation/pull/163#discussion_r336967295 :

+The CMS used to provide page publish and unpublish signals which have since been removed in DjangoCMS 4.0. You can instead use the signals provided above to replace these. + +Djangocms-moderation provides a way to take further actions once a collection has been published. The published event is the last event executed for a moderation. + + +.. code-block:: python +

  • from django.dispatch import receiver
  • from cms.models import PageContent
  • from djangocm_moderation.signals import published
  • @receiver(published)
  • def do_something_unpublish_event(*args, **kwargs):

Personally I'd go for separate signals as they are separate concerns. We should stay consistent with Versioning.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/divio/djangocms-moderation/pull/163?email_source=notifications&email_token=AAQGYEVXRDV23PYR3WJOXD3QPWHVBA5CNFSM4JALN2G2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCITD4CY#discussion_r336967295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQGYEXXVQLTR5QLPCIB5MTQPWHVBANCNFSM4JALN2GQ .

-- Sent from Gmail Mobile

Aiky30 commented 4 years ago

Merging with failures due to the fact that this is documentation and contains no code changes. CircleCI have changed their pricing plan and we are using features that are no longer part of the open source offering.