#33174: Having a model inherit from Generic[T] breaks makemigrations
--------------------------------+--------------------------------------
     Reporter:  Antoine Humeau  |                    Owner:  nobody
         Type:  New feature     |                   Status:  closed
    Component:  Migrations      |                  Version:  3.2
     Severity:  Normal          |               Resolution:  wontfix
     Keywords:                  |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+--------------------------------------

Comment (by Jacob Fredericksen):

 I think this should be revisited. Python 3.12 introduces new syntax for
 generic classes without explicit inheritance from typing.Generic
 (https://docs.python.org/3/whatsnew/3.12.html#pep-695-type-parameter-
 syntax), so having to trick Django by adding verbose TYPE_CHECKING
 conditionals and explicit Generic inheritance is a bummer. Removing
 typing.Generic from the list of bases in the migration file seems to work
 just fine, though.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33174#comment:6>
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/0107018c03db1ee4-a6786233-c470-44c1-8825-f02cacef1294-000000%40eu-central-1.amazonses.com.

Reply via email to