Skip to main content

splent_feature_survey

The survey feature of a SPLENT product line.

Native questionnaires. The panel builds a survey out of questions (a scale between two bounds, short or long text, single or multiple choice, yes or no, an email address), visitors fill it at /survey/<slug> without an account, and the panel reads the answers back, counted per option and averaged for a scale. An unpublished survey answers 404 to everyone but the panel's accounts, who preview it with a notice that it is a draft, and nobody can answer it. A survey whose closes_at has passed says it is closed and takes no more answers. The introduction and the thank you text are stored HTML, and the form, its preview and the thank you page draw them through the framework's rich_text filter, which keeps the formatting and drops scripts, event handlers and javascript: links. It needs auth.

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.

Access

The screens under /admin/surveys and /admin/questions, where the surveys are built, changed and deleted and their answers are read, 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 Surveys link in the sidebar, and an anonymous visitor is sent to log in. The answers hold whatever the respondents typed, email addresses included, so only the panel reads them.

The form of a published survey at /survey/<slug> stays open to everyone, signed in or not. An unpublished survey opens there only to the accounts the admin screens let in, as a preview with a notice that it is a draft and the submit button disabled, and nobody can answer it. Everyone else gets 404, as for a survey that does not exist.

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 survey.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 and the preview of an unpublished survey follow the same answer. For the preview the policy is asked about survey.admin_index with the survey's slug as view_args, {"slug": "<slug>"}, so it can let an account preview some surveys and not others. That is the way to let a group of accounts manage only this section, for example the people who run the questionnaires, 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 run nothing but the surveys needs a policy instead.

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

Use it in a product

splent feature:add splent_feature_survey

Develop

splent feature:test splent_feature_survey
splent feature:contract splent_feature_survey

Release

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

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-survey 0.2.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-survey 0.2.0
File Size Uploaded Provenance Actions
splent_feature_survey-0.2.0.tar.gz 37.2 kB Without provenance Details for splent_feature_survey-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 87.4 kB

Release files / splent_feature_survey-0.2.0.tar.gz

Download URL splent_feature_survey-0.2.0.tar.gz
Size 37.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b5b1214d39ef538e5c8cd675772b5dc3af66336a215532478c1e8e32c41de7c8
BLAKE2b-256 checksum
How to use checksums
a383718f142ee34809cdecfd05e97c6d6d17cde211a6a4dcfaa2e840bb31e286
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_survey-0.2.0-py3-none-any.whl

Download URL splent_feature_survey-0.2.0-py3-none-any.whl
Size 50.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82d5d2a9fe7ec8fb14b522271fa6b002c4bc1a191a1c2c769928524a39caed7f
BLAKE2b-256 checksum
How to use checksums
612ab9f13a452a99743906d295d83ea9132abd39045939df3fc467cd55b822ac
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-survey 0.2.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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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