#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070191197f9b45-9c367b3a-6f96-483b-ad5c-d6b2c298d08f-000000%40eu-central-1.amazonses.com.