:py:mod:`core.modules.page` =========================== .. py:module:: core.modules.page Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: core.modules.page.PageSkel core.modules.page.Page .. py:class:: PageSkel(*args, **kwargs) Bases: :py:obj:`viur.core.prototypes.tree.TreeSkel` This is a container-object holding information about one database entity. It has to be sub-classed with individual information about the kindName of the entities and its specific data attributes, the so called bones. The Skeleton stores its bones in an :class:`OrderedDict`-Instance, so the definition order of the contained bones remains constant. :ivar key: This bone stores the current database key of this entity. Assigning to this bones value is dangerous and does *not* affect the actual key its stored in. :vartype key: server.bones.BaseBone :ivar creationdate: The date and time where this entity has been created. :vartype creationdate: server.bones.DateBone :ivar changedate: The date and time of the last change to this entity. :vartype changedate: server.bones.DateBone .. py:attribute:: kindName :value: 'page' .. py:attribute:: searchindex :value: 'page' .. py:attribute:: name .. py:attribute:: descr .. py:class:: Page(moduleName, modulePath, *args, **kwargs) Bases: :py:obj:`viur.core.prototypes.tree.Tree` Tree module prototype. It is used for hierarchical structures, either as a tree with nodes and leafs, or as a hierarchy with nodes only. .. py:attribute:: adminInfo .. py:attribute:: viewTemplate :value: 'page_view' .. py:method:: getAvailableRootNodes(*args, **kwargs) Default function for providing a list of root node items. This list is requested by several module-internal functions and *must* be overridden by a custom functionality. The default stub for this function returns an empty list. An example implementation could be the following: .. code-block:: python # Example def getAvailableRootNodes(self, *args, **kwargs): q = db.Query(self.rootKindName) ret = [{"key": str(e.key()), "name": e.get("name", str(e.key().id_or_name()))} #FIXME for e in q.run(limit=25)] return ret :param args: Can be used in custom implementations. :param kwargs: Can be used in custom implementations. :return: Returns a list of dicts which must provide a "key" and a "name" entry with respective information.