#35656: Make migration Command doesn't allow changing the autodetector
-------------------------------------+-------------------------------------
Reporter: Ahmed | Owner: leondaz
Ibrahim |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version:
Migrations | Keywords: migrations,
Severity: Normal | makemigrations, commands
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
I had a situation where I want to subclass the Autodetector to add more
operations that the ones in Django, an operation that does not create a
row, but rather, a table (different model)
This line is copied from
`django/django/core/management/commands/makemigrations.py`
{{{
# Detect changes
changes = autodetector.changes(
graph=loader.graph,
trim_to_apps=app_labels or None,
convert_apps=app_labels or None,
migration_name=self.migration_name,
)
}}}
The suggested approach is to save the `autodetector` on the class level,
and subclasses can override it to use their custom version.
P.S: I'm not sure if this is considered a feature or an optimization
--
Ticket URL: <
https://code.djangoproject.com/ticket/35656>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.