Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc+fix: Added module docstrings, removed render defaults #1253

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/viur/core/modules/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,10 +970,6 @@ def mark_for_deletion(self, dlkey: str) -> None:
db.Put(fileObj)


File.json = True
File.html = True


@PeriodicTask(interval=datetime.timedelta(hours=4))
def startCheckForUnreferencedBlobs():
"""
Expand Down
4 changes: 4 additions & 0 deletions src/viur/core/modules/formmailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class MailSkel(RelSkel):


class Formmailer(Module):
"""
Formmailer is the standard module to implement a form mailer for contact request or similar forms.
"""

mailTemplate = None

@exposed
Expand Down
3 changes: 0 additions & 3 deletions src/viur/core/modules/moduleconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,3 @@ def collect_modules(parent, depth: int = 0, prefix: str = "") -> None:

collect_modules(conf.main_app.vi)
# TODO: Remove entries from MODULECONF_KINDNAME which are in db_module_names but not in ModuleConf.MODULES


ModuleConf.json = True
5 changes: 4 additions & 1 deletion src/viur/core/modules/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class PageSkel(TreeSkel):


class Page(Tree):
"""
A simple page construction module, allowing to create a structure of pages.
"""

adminInfo = {
"name": "Pages",
"handler": "tree.nodeonly.page",
Expand All @@ -41,4 +45,3 @@ def getAvailableRootNodes(self, *args, **kwargs):


Page.html = True
Page.json = True
7 changes: 4 additions & 3 deletions src/viur/core/modules/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ class ScriptLeafSkel(BaseScriptAbstractSkel):


class Script(Tree):
"""
Script is a system module used to serve a filesystem for scripts used by ViUR Scriptor and ViUR CLI.
"""

leafSkelCls = ScriptLeafSkel
nodeSkelCls = ScriptNodeSkel

Expand Down Expand Up @@ -156,6 +160,3 @@ def update_path(self, skel):
key = parent_skel["parententry"]

skel["path"] = "/".join(path)


Script.json = True
7 changes: 7 additions & 0 deletions src/viur/core/modules/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@


class Site(Module):
"""
The Site module simply serves static templates without a module-binding stored in html/sites.

It is normally imported as `s` module in modern ViUR projects, to serve pages under short URL.
Therefore, a template `html/sites/imprint.html` can be accessed via `/s/imprint` by default.
"""

adminInfo = None

@exposed
Expand Down
4 changes: 4 additions & 0 deletions src/viur/core/modules/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def preProcessSerializedData(cls, skelValues: SkeletonInstance, entity: db.Entit


class Translation(List):
"""
The Translation module is a system module used by the ViUR framework for its internationalization capabilities.
"""

kindName = KINDNAME

def adminInfo(self):
Expand Down
6 changes: 6 additions & 0 deletions src/viur/core/modules/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,12 @@ def authenticator_otp(self, **kwargs):


class User(List):
"""
The User module is used to manage and authenticate users in a ViUR system.

It is used in almost any ViUR project, but ViUR can also function without any user capabilites.
"""

kindName = "user"
addTemplate = "user_add"
addSuccessTemplate = "user_add_success"
Expand Down
Loading