Skip to content

Conversation

@pfouque
Copy link
Member

@pfouque pfouque commented Jan 28, 2026

Description

Inspired by discussion in #47 and the awesome work of @ticosax I drafted this solution (using codex).
It's probably not perfect but gives us a good support to discuss the target and the path to migrate.
As discussed previously, I'd like to kill 2 birds with one rock and make it possible to store all logs in a single table or having a dedicated table for each model to track.
I kept the centralized table (and its GenericForeignKey) but it's providing a "Bring your own model" where you can have a strong foreignkey.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Other (no functional changes)

Checklist

  • I have read the CONTRIBUTING.md guide
  • Tests added/updated for the changes
  • All tests pass locally (uv run pytest or pytest)
  • Linting passes (uv run ruff check .)
  • Documentation updated (if applicable)
  • CHANGELOG.rst updated (for user-facing changes)

Testing

# Commands used to test
uv run pytest tests/test_xxx.py -v

Related Issues

@pfouque pfouque changed the base branch from main to mypy_level_1 January 28, 2026 17:02
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 83.42857% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
django_fsm/log.py 79.79% 20 Missing ⚠️
django_fsm/admin.py 66.66% 9 Missing ⚠️
Files with missing lines Coverage Δ
django_fsm/apps.py 100.00% <100.00%> (ø)
django_fsm/migrations/0001_initial.py 100.00% <100.00%> (ø)
django_fsm/models.py 100.00% <100.00%> (ø)
django_fsm/admin.py 66.66% <66.66%> (ø)
django_fsm/log.py 79.79% <79.79%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pfouque pfouque force-pushed the logging_freshstart branch from f6a1cae to cf152b5 Compare January 29, 2026 08:55
@RemiDesgrange
Copy link

I won't comment on the code in model directly (looks clean, but I've only looked at it)

But the track decorator is a clean and wonderful idea ! Nice job.

@pfouque
Copy link
Member Author

pfouque commented Jan 29, 2026

But the track decorator is a clean and wonderful idea ! Nice job.

Congrats need to be addressed to pg-history! 😉

@pfouque pfouque force-pushed the logging_freshstart branch from cf152b5 to e74e29a Compare January 29, 2026 13:37
@pfouque pfouque changed the title [DRAFT] Logging freshstart [DRAFT] Logging Feb 2, 2026
@pfouque pfouque force-pushed the mypy_level_1 branch 6 times, most recently from 6f5e624 to dde82e8 Compare February 4, 2026 16:17
Base automatically changed from mypy_level_1 to main February 4, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants