Skip to main content

splent_feature_comments

The comments feature of a SPLENT product line.

A SPLENT feature is a Python package that a product composes with others. Its models, routes, services, templates and hooks are registered when the product starts. What this feature provides and requires is listed in the [tool.splent.contract] section of pyproject.toml, which splent feature:contract --write keeps in sync with the source.

What it does

Visitor comments on the posts of the post feature. The thread and its form are drawn into each post through the post.comments hook, and the form posts to /comments/<post_id>. The form shows only on a post the public can read, as the post feature's PostService.is_public decides. A new comment waits for moderation unless COMMENTS_AUTO_APPROVE, or the Comments settings panel, publishes it at once. A captcha feature can veto a submission through the comment-submitting signal.

The panel moderates the comments at /admin/comments, where they are approved or deleted.

Access

The screens under /admin/comments open for the accounts whose role is admin or staff, the same pair the admin dashboard lets in. Any other signed-in account gets 403 and does not see the Comments link in the sidebar, and an anonymous visitor is sent to log in. Leaving a comment stays open to everyone, signed in or not, on a post the public can read whose comments are open. A draft or a scheduled post answers 404 to a comment, and its preview in the panel shows the thread without the form.

There is no setting for these roles, and a refinement cannot replace the views that check them, because it may add routes to this feature but never replace one of its own. Another feature can decide for these screens with an access policy registered for the prefix comments.admin (register_access_policy, splent_framework 1.20.0). The framework asks the policy before the roles. It answers True to let an account in, False to refuse it, or None to leave the decision to the roles, and the sidebar link follows the same answer. That is the way to let a group of accounts manage only this section, for example the people who moderate the blog, without giving them a panel role. See Access control.

Without such a feature, give the person's account the staff role. Staff opens every panel screen that asks for PANEL_ROLES, not only this one, so a person who should moderate nothing but the comments needs a policy instead.

splent feature:auth set-role someone@example.com staff

Use it in a product

splent feature:add splent_feature_comments

Develop

splent feature:test splent_feature_comments
splent feature:contract splent_feature_comments

Release

splent feature:release splent_feature_comments --dry-run --bump patch
splent feature:release splent_feature_comments

The first command rehearses the release and changes nothing. The second publishes it to the git forge and to PyPI, and a PyPI version is permanent.

Metadata

Release files for splent-feature-comments 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splent-feature-comments 0.3.0
File Size Uploaded Provenance Actions
splent_feature_comments-0.3.0.tar.gz 29.5 kB Without provenance Details for splent_feature_comments-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splent-feature-comments 0.3.0
File Interpreter ABI Platform Actions
splent_feature_comments-0.3.0-py3-none-any.whl Python 3 none any Details for splent_feature_comments-0.3.0-py3-none-any.whl

Total release size: 65.7 kB

Release files / splent_feature_comments-0.3.0.tar.gz

Download URL splent_feature_comments-0.3.0.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f28fee592289e94a0eef26e40e1e8eff1ab4de0dc30b3d7453f67eaa273ea3d8
BLAKE2b-256 checksum
How to use checksums
545116a79ecc587a028bc0e3ff2a4f3d48908cf4149b0796c658510496f7d9b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / splent_feature_comments-0.3.0-py3-none-any.whl

Download URL splent_feature_comments-0.3.0-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54060142801945265b3fc93f09c54eeab94eb91a8f93f3b2ec629f6bd6e24a82
BLAKE2b-256 checksum
How to use checksums
f7a7ae4416130bc2edc112430c948116ec5c812ecb12dce3b00e88b4b0d72f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for splent-feature-comments 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page