PageRenderTime 156ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/ref/contrib/comments/signals.txt

https://code.google.com/p/mango-py/
Plain Text | 91 lines | 64 code | 27 blank | 0 comment | 0 complexity | 9e60ad21cf4c26a23ccf387ea2df6b7d MD5 | raw file
Possible License(s): BSD-3-Clause
  1. ================================
  2. Signals sent by the comments app
  3. ================================
  4. .. module:: django.contrib.comments.signals
  5. :synopsis: Signals sent by the comment module.
  6. The comment app sends a series of :doc:`signals </topics/signals>` to allow for
  7. comment moderation and similar activities. See :doc:`the introduction to signals
  8. </topics/signals>` for information about how to register for and receive these
  9. signals.
  10. comment_will_be_posted
  11. ======================
  12. .. data:: django.contrib.comments.signals.comment_will_be_posted
  13. :module:
  14. Sent just before a comment will be saved, after it's been sanity checked and
  15. submitted. This can be used to modify the comment (in place) with posting
  16. details or other such actions.
  17. If any receiver returns ``False`` the comment will be discarded and a 403 (not
  18. allowed) response will be returned.
  19. This signal is sent at more or less the same time (just before, actually) as the
  20. ``Comment`` object's :data:`~django.db.models.signals.pre_save` signal.
  21. Arguments sent with this signal:
  22. ``sender``
  23. The comment model.
  24. ``comment``
  25. The comment instance about to be posted. Note that it won't have been
  26. saved into the database yet, so it won't have a primary key, and any
  27. relations might not work correctly yet.
  28. ``request``
  29. The :class:`~django.http.HttpRequest` that posted the comment.
  30. comment_was_posted
  31. ==================
  32. .. data:: django.contrib.comments.signals.comment_was_posted
  33. :module:
  34. Sent just after the comment is saved.
  35. Arguments sent with this signal:
  36. ``sender``
  37. The comment model.
  38. ``comment``
  39. The comment instance that was posted. Note that it will have already
  40. been saved, so if you modify it you'll need to call
  41. :meth:`~django.db.models.Model.save` again.
  42. ``request``
  43. The :class:`~django.http.HttpRequest` that posted the comment.
  44. comment_was_flagged
  45. ===================
  46. .. data:: django.contrib.comments.signals.comment_was_flagged
  47. :module:
  48. Sent after a comment was "flagged" in some way. Check the flag to see if this
  49. was a user requesting removal of a comment, a moderator approving/removing a
  50. comment, or some other custom user flag.
  51. Arguments sent with this signal:
  52. ``sender``
  53. The comment model.
  54. ``comment``
  55. The comment instance that was posted. Note that it will have already
  56. been saved, so if you modify it you'll need to call
  57. :meth:`~django.db.models.Model.save` again.
  58. ``flag``
  59. The :class:`~django.contrib.comments.models.CommentFlag` that's been
  60. attached to the comment.
  61. ``created``
  62. ``True`` if this is a new flag; ``False`` if it's a duplicate flag.
  63. ``request``
  64. The :class:`~django.http.HttpRequest` that posted the comment.