#33323: On custom migrations, import of model classes with
app.get_model('appname',
'ModelName') ignores overwritten models.Model methods
-----------------------------------+--------------------------------------
Reporter: Andreas Scheucher | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 3.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Tim Graham):
* status: new => closed
* resolution: => invalid
Comment:
[https://docs.djangoproject.com/en/stable/topics/migrations/#historical-
models As documented]:
> Because it’s impossible to serialize arbitrary Python code, these
historical models will not have any custom methods that you have defined.
They will, however, have the same fields, relationships, managers (limited
to those with use_in_migrations = True) and Meta options (also versioned,
so they may be different from your current ones).
>
> This means that you will NOT have custom save() methods called on
objects when you access them in migrations, and you will NOT have any
custom constructors or instance methods.
--
Ticket URL: <https://code.djangoproject.com/ticket/33323#comment:1>
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/068.24f57e94bb600c5b5f2b366b7b557368%40djangoproject.com.