Skip to content

feat: implement autodiscover mechanism for automatic model registration #1504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

remifu93
Copy link

Description

This PR introduces a centralized autodiscovery mechanism in historical.py that automatically registers models for historical tracking. The purpose is to isolate and unify all registration logic in a single place for better code organization and scalability.

Motivation and Context

  • Centralizes register() logic for historical models into a dedicated module.
  • Eliminates the need to manually call registration in multiple places.
  • Encourages a cleaner, more scalable project structure.
  • Reduces the risk of missing or duplicated model registrations.
  • Enables plug-and-play behavior: importing the module is enough to apply the registration.

How Has This Been Tested?

  • Manually tested in a Django project to confirm that historical models are registered correctly.
  • Verified that historical tracking works as expected after migrations.
  • Ran the full test suite to ensure no regressions.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have run the pre-commit run command to format and lint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have added my name and/or GitHub handle to AUTHORS.rst
  • I have added my change to CHANGES.rst
  • All new and existing tests passed.

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.

1 participant