hooks.rst 1.1 KB

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