Skip to main content

splent_feature_team

The team 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

A directory of people. /team lists the published members grouped by role, in the order of Role.order, and /team/<slug> shows one profile. A member can hold several roles and then appears under each of them. A member's bio is stored HTML, and the profile draws it through the framework's rich_text filter, which keeps the formatting and drops scripts, event handlers and javascript: links.

A member who is not published stays off both pages, and /team/<slug> answers 404 for them. The panel's accounts still open the profile to check it, with a notice that the public does not see it.

The panel manages it at /admin/team (members) and /admin/team/roles (roles). Only the panel's accounts reach those screens.

Addresses

The member's photo, website and profile links and the role's logo and website end up in a src or an href of the public pages, so the forms check them before they store them.

Address Allowed
A member's photo, a role's logo An http:// or https:// address, or a path on the site such as /static/uploads/logo.png
A member's website and profile links, a role's website An http:// or https:// address

A value that breaks a rule is refused with a message, nothing is saved, and the form comes back with what was typed. A photo, a logo or a website longer than its 512 character column is refused rather than cut, since a cut address points somewhere else. The member form has no website field, so saving it keeps the website a seeder set.

A seeder writes the columns directly and is not checked. Every template draws a stored address through the framework's safe_url filter, so one that is not http, https, mailto or a path on the site renders as an empty href or src instead of running.

Roles that stand for an organisation

A role is a section of the page. When a product groups its people by organisation (a university, a company, a partner lab), each organisation is a role, and the role can carry three optional details.

Column What the public page shows
description a paragraph under the section heading
logo an image beside the heading, an image URL like TeamMember.photo
link the website, linked from the logo and shown as an address

A role without any of them renders as the bare heading it always was, so products that group by job (Faculty, Students, Staff) see no difference.

In the panel, the Details button of each role on /admin/team/roles opens the full form, where the logo is picked from the media library.

The form checks the logo and the website as described in Addresses, and a role whose details are refused keeps what it had.

A product seeds its organisations with its own seeder, replacing this feature's sample data.

import os

from splent_framework.seeders.BaseSeeder import BaseSeeder
from splent_io.splent_feature_media.services import MediaService
from splent_io.splent_feature_team.models import Role, TeamMember

LOGOS = os.path.join(os.path.dirname(__file__), "static", "logos")


class MyTeamSeeder(BaseSeeder):
    replaces = ("splent_io.splent_feature_team.seeders",)

    def run(self):
        logo = MediaService().import_from_file(
            os.path.join(LOGOS, "somewhere.svg"), source_key="seed://my/somewhere"
        )
        [university] = self.seed(
            [
                Role(
                    name="University of Somewhere",
                    slug="university-of-somewhere",
                    order=1,
                    description="Develops and runs the platform.",
                    logo=logo.url,
                    link="https://www.somewhere.example",
                )
            ]
        )
        person = TeamMember(name="Ada Lovelace", slug="ada-lovelace")
        person.roles = [university]
        self.seed([person])

A product that wants other markup for the page overrides team/list.html in its own templates. Each group is a Role with description, logo and link next to its name.

Use it in a product

splent feature:add splent_feature_team

Develop

splent feature:test splent_feature_team
splent feature:contract splent_feature_team

Release

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

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-team 0.6.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-team 0.6.0
File Size Uploaded Provenance
splent_feature_team-0.6.0.tar.gz 1.8 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for splent-feature-team 0.6.0
File Interpreter ABI Platform
splent_feature_team-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.6 MB

Release files / splent_feature_team-0.6.0.tar.gz

Download URL splent_feature_team-0.6.0.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
27aaddccb295eee2e96198f28b3cc9bf6412695353706b86b2ced92b10381b66
BLAKE2b-256 checksum
How to use checksums
0539430dc8b7d3b4ba1318047052356fff32040d15d898a3c5db7714f83ad7b4
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_team-0.6.0-py3-none-any.whl

Download URL splent_feature_team-0.6.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
808dc20bcac61c03682fe0bf93ecccd5360f72bc15060b7249dbac765de73058
BLAKE2b-256 checksum
How to use checksums
7f4329ed481a671cdf582ec1897dbabb5bef9baba07d58d27f446c85fe99b0b8
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-team 0.6.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