Support commitments across projects, subprojects, contexts and tags#5
Merged
Fingolfin7 merged 1 commit intomasterfrom Feb 23, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
aggregation_typefield and optional one-to-one target fields (project,subproject,context,tag) to theCommitmentmodel and added model-levelclean()validation to require exactly one target and ensure the target belongs to the same user. (core/models.py)get_commitment_sessions_queryset()and updatedget_commitment_progress(),calculate_commitment_streak()andreconcile_commitment()to aggregate sessions according to the selectedaggregation_type(project membership, subproject relation, project context, or project tags). (core/utils.py)CommitmentFormto presentaggregation_typeplus per-userModelChoiceFields for project/subproject/context/tag, normalize the chosen target duringclean(), and initialize project-scoped creates whenproject_pkis provided. (core/forms.py)target_namewith the aggregation type. (core/views.py,core/urls.py,core/templates/core/*.html)0034_commitment_aggregation_type_commitment_context_and_more.pyto alter the commitment schema. (core/migrations/0034_*.py)Testing
python manage.py makemigrations corewhich produced the migration for the schema changes successfully. (succeeded)python manage.py test core.tests.CommitmentViewTests core.tests.UpdateProjectViewCommitmentTests core.tests.ProjectsListViewCommitmentTests core.tests.CommitmentStreakTestsand validated the tests passed. (succeeded)Codex Task