From 7610eb231e065ae59d07391b36717b79d4e58250 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 19 Aug 2014 00:39:33 +0200 Subject: Start for documenting core hooks. This is basicly a start by Chris Webber, I'm just commiting it for him. --- docs/source/pluginwriter/hooks.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/source/pluginwriter/hooks.rst (limited to 'docs/source/pluginwriter') diff --git a/docs/source/pluginwriter/hooks.rst b/docs/source/pluginwriter/hooks.rst new file mode 100644 index 00000000..5272266c --- /dev/null +++ b/docs/source/pluginwriter/hooks.rst @@ -0,0 +1,19 @@ +.. MediaGoblin Documentation + + Written in 2014 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + + +=============================== +Documentation on Built-in Hooks +=============================== + +This section explains built-in hooks to MediaGoblin. -- cgit v1.2.3 From 3322a63df41f1b58d830aad0156160e6b532b5d7 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 19 Aug 2014 00:56:37 +0200 Subject: Add docs on collection_add_media hook. --- docs/source/pluginwriter/hooks.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs/source/pluginwriter') diff --git a/docs/source/pluginwriter/hooks.rst b/docs/source/pluginwriter/hooks.rst index 5272266c..4aa062e8 100644 --- a/docs/source/pluginwriter/hooks.rst +++ b/docs/source/pluginwriter/hooks.rst @@ -17,3 +17,19 @@ Documentation on Built-in Hooks =============================== This section explains built-in hooks to MediaGoblin. + + +What hooks are available? +========================= + +'collection_add_media' +---------------------- + +This hook is used by ``add_media_to_collection`` +in ``mediagoblin.user_pages.lib``. +It gets a ``CollectionItem`` as its argument. +It's the newly created item just before getting commited. +So the item can be modified by the hook, if needed. +Changing the session regarding this item is currently +undefined behaviour, as the SQL Session might contain other +things. -- cgit v1.2.3