Fixed Copyright Headers
[mediagoblin.git] / docs / source / pluginwriter / hooks.rst
1 .. MediaGoblin Documentation
2
3 Written in 2014 by MediaGoblin contributors
4
5 To the extent possible under law, the author(s) have dedicated all
6 copyright and related and neighboring rights to this software to
7 the public domain worldwide. This software is distributed without
8 any warranty.
9
10 You should have received a copy of the CC0 Public Domain
11 Dedication along with this software. If not, see
12 <http://creativecommons.org/publicdomain/zero/1.0/>.
13
14
15 ===============================
16 Documentation on Built-in Hooks
17 ===============================
18
19 This section explains built-in hooks to MediaGoblin.
20
21
22 What hooks are available?
23 =========================
24
25 'collection_add_media'
26 ----------------------
27
28 This hook is used by ``add_media_to_collection``
29 in ``mediagoblin.user_pages.lib``.
30 It gets a ``CollectionItem`` as its argument.
31 It's the newly created item just before getting commited.
32 So the item can be modified by the hook, if needed.
33 Changing the session regarding this item is currently
34 undefined behaviour, as the SQL Session might contain other
35 things.