コード例 #1
0
    def onDeleted(self, skel: SkeletonInstance):
        """
			Hook function that is called after deleting an entry.

			It should be overridden for a module-specific behavior.
			The default is writing a log entry.

			:param skel: The Skeleton that has been deleted.
			:type skel: :class:`viur.core.skeleton.Skeleton`

			.. seealso:: :func:`delete`, :func:`onDelete`
		"""
        logging.info("Entry deleted: %s" % skel["key"])
        flushCache(key=skel["key"])
        user = utils.getCurrentUser()
        if user:
            logging.info("User: %s (%s)" % (user["name"], user["key"]))
コード例 #2
0
ファイル: tree.py プロジェクト: phorward/viur-core
    def onEdited(self, skelType, skel):
        """
		Hook function that is called after modifying an entry.

		It should be overridden for a module-specific behavior.
		The default is writing a log entry.

		:param skel: The Skeleton that has been modified.
		:type skel: :class:`server.skeleton.Skeleton`

		.. seealso:: :func:`edit`, :func:`onEdit`
		"""
        logging.info("Entry of kind %r changed: %s", skelType, skel["key"])
        flushCache(key=skel["key"])
        user = utils.getCurrentUser()
        if user:
            logging.info("User: %s (%s)" % (user["name"], user["key"]))
コード例 #3
0
ファイル: tree.py プロジェクト: viur-framework/viur-core
    def onAdded(self, skel):
        """
		Hook function that is called after adding an entry.

		It should be overridden for a module-specific behavior.
		The default is writing a log entry.

		:param skel: The Skeleton that has been added.
		:type skel: :class:`server.skeleton.Skeleton`

		.. seealso:: :func:`add`, :func:`onAdd`
		"""
        logging.info("Entry added: %s" % skel["key"])
        flushCache(kind=skel.kindName)
        user = utils.getCurrentUser()
        if user:
            logging.info("User: %s (%s)" % (user["name"], user["key"]))
コード例 #4
0
ファイル: tree.py プロジェクト: phorward/viur-core
    def onDeleted(self, skelType, skel):
        """
		Hook function that is called after deleting an entry.

		It should be overridden for a module-specific behavior.
		The default is writing a log entry.

		..warning: Saving the skeleton again will undo the deletion
		(if the skeleton was a leaf or a node with no children).

		:param skel: The Skeleton that has been deleted.
		:type skel: :class:`server.skeleton.Skeleton`

		.. seealso:: :func:`delete`, :func:`onDelete`
		"""
        logging.info("Entry deleted: %s (%s)" % (skel["key"], type(skel)))
        flushCache(key=skel["key"])
        user = utils.getCurrentUser()
        if user:
            logging.info("User: %s (%s)" % (user["name"], user["key"]))