Skip to main content

splent_feature_academic_profile

The academic_profile feature of a SPLENT product line.

It gives every profile an affiliation, the university, institute or company a person works for, as research repositories and academic hubs show next to a name. The person sets it on profile's edit page, and it travels with the profile's JSON at /api/v1/profile/me, where a form that fills in the author of a deposit reads it. It is optional, and an empty box stores no affiliation.

It needs profile. A product without it keeps profiles with a name and a surname only. With a profile older than register_profile_field and register_profile_payload, the column is still added, the edit page and the JSON leave the affiliation out, the log says why, and the product starts.

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.

How it extends profile

academic_profile is a refinement of splent_feature_profile that only extends. It overrides no template, service or route of profile.

What How
The affiliation column, a string of up to 255 characters that may be empty A declared model extension of UserProfile ([tool.splent.refinement.extends]), with this feature's own migrations
The field on the edit page, after the surname profile's register_profile_field
The affiliation key of /api/v1/profile/me profile's register_profile_payload
[tool.splent.refinement]
refines = "splent_feature_profile"

[tool.splent.refinement.extends]
models = [{ target = "UserProfile", mixin = "AcademicProfileMixin" }]
{"name": "Ada", "surname": "Lovelace", "email": "ada@example.com", "affiliation": "University of Seville"}

Migrations

The column lives on profile's user_profile table, and two revisions of this feature manage it.

Revision What it does
pu0001 Adds affiliation as a nullable VARCHAR(255), unless the table already has it
pu0002 Widens an affiliation shorter than 255 characters, keeping its data

A database where an earlier feature already added this column under revision pu0001, at 100 characters, migrates without a second ALTER TABLE ... ADD. Whether that revision is carried over to this feature's version table or this feature starts from an empty one, pu0001 creates the column once and pu0002 brings it to the 255 characters the form accepts.

Rolling back never deletes an affiliation. pu0002 keeps the width, and pu0001 drops the column only when no profile has an affiliation. When it found the column instead of creating it, pu0001 cannot tell afterwards whether the values are its own or an earlier feature's, so a column that holds any stays, with its values, and upgrading again picks them up. The log says so, and the column can be dropped by hand once nobody needs them.

splent db:upgrade

Translations

The field's label and placeholder ship with a Spanish catalog.

Use it in a product

splent feature:add splent_feature_academic_profile

Develop

splent feature:test splent_feature_academic_profile
splent feature:contract splent_feature_academic_profile

Release

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

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-academic-profile 0.1.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-academic-profile 0.1.0
File Size Uploaded Provenance Actions
splent_feature_academic_profile-0.1.0.tar.gz 22.3 kB Without provenance Details for splent_feature_academic_profile-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splent-feature-academic-profile 0.1.0
File Interpreter ABI Platform Actions
splent_feature_academic_profile-0.1.0-py3-none-any.whl Python 3 none any Details for splent_feature_academic_profile-0.1.0-py3-none-any.whl

Total release size: 48.0 kB

Release files / splent_feature_academic_profile-0.1.0.tar.gz

Download URL splent_feature_academic_profile-0.1.0.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
60518bff9391ae4315707202a8ef836f031bf364f6267ac6d6197e4e91b1b1c0
BLAKE2b-256 checksum
How to use checksums
2f4064465df45b378b9c05f7e752c815045360b5a466db360a46f1db2fd007c1
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_academic_profile-0.1.0-py3-none-any.whl

Download URL splent_feature_academic_profile-0.1.0-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4a684e7558f0751a63adc0907ba21ab3cacbca01ff2c3eae72f1f513484739b
BLAKE2b-256 checksum
How to use checksums
928c9080cc22c44dffd7e2fd59e9ea54e54afcafb6f4f67a0d5e62a4f8b9b0bc
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-academic-profile 0.1.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.1.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