mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
fix outdated content_object_init refs
* remove content_object_init section from docs * improve content_object_init test The content_object_init signal used to set its class as sender and pass the instance as additional arg in6100773. Commited907b4removed this behaviour to bring it inline with other signals, on the basis that you can test for the class of the object anyway. We also had a test in place, checking this behaviour, but it was poorly implemented, not actually checking if the function ever got called. closes #1711
This commit is contained in:
parent
e17c4377da
commit
e3f5e39e17
2 changed files with 20 additions and 33 deletions
|
|
@ -116,31 +116,11 @@ static_generator_preread static_generator invoked befor
|
|||
staticfiles list.
|
||||
static_generator_init static_generator invoked in the StaticGenerator.__init__
|
||||
static_generator_finalized static_generator invoked at the end of StaticGenerator.generate_context
|
||||
content_object_init content_object invoked at the end of Content.__init__ (see note below)
|
||||
content_object_init content_object invoked at the end of Content.__init__
|
||||
content_written path, context invoked each time a content file is written.
|
||||
feed_written path, context, feed invoked each time a feed file is written.
|
||||
================================= ============================ ===========================================================================
|
||||
|
||||
The list is currently small, so don't hesitate to add signals and make a pull
|
||||
request if you need them!
|
||||
|
||||
.. note::
|
||||
|
||||
The signal ``content_object_init`` can send a different type of object as
|
||||
the argument. If you want to register only one type of object then you will
|
||||
need to specify the sender when you are connecting to the signal.
|
||||
|
||||
::
|
||||
|
||||
from pelican import signals
|
||||
from pelican import contents
|
||||
|
||||
def test(sender, instance):
|
||||
print "%s : %s content initialized !!" % (sender, instance)
|
||||
|
||||
def register():
|
||||
signals.content_object_init.connect(test, sender=contents.Article)
|
||||
|
||||
.. warning::
|
||||
|
||||
Avoid ``content_object_init`` signal if you intend to read ``summary``
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue