#25068: Metaclass conflict when doing createmigrations in ModelState.render
-------------------------------------+-------------------------------------
     Reporter:  kosz85               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Migrations           |                  Version:  1.8
     Severity:  Normal               |               Resolution:
     Keywords:  metaclass conflict   |             Triage Stage:  Accepted
  createmigrations                   |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by loic):

 I don't think this is the right approach.

 The current status of inheritance in migrations:
 - Inheritance is only partially supported (abstract models are ignored) in
 `CreateModel()` with the `bases` kwarg.
 - Inheritance changes aren't tracked over time.
 - Metaclasses aren't supported.

 With the exception of abstract models (ignoring them was a deliberate
 design decision by Andrew), we could cleanly fix all the other
 shortcomings by:
 - Adding a `metaclass=ModelBase` kwarg to `CreateModel()`.
 - Adding a `AlterModelClass(bases, metaclass)` operation.

 Doing so would bring us closer to standard Python inheritance, support
 changes over time, and replace the proposed runtime magic with a
 declarative syntax.

--
Ticket URL: <https://code.djangoproject.com/ticket/25068#comment:25>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.cdcb47fbd90136a8a900d9a8df17c093%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to