#23574: Makemigrations tries to migrate non-model classes
-------------------------------+--------------------
     Reporter:  shredding      |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Migrations     |    Version:  1.7
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 If your model extends non-model classes, the migration fails with:

     raise ValueError("Cannot serialize: %r\nThere are some values Django
 cannot serialize into migration files.\nFor more, see
 https://docs.djangoproject.com/en/dev/topics/migrations/#migration-
 serializin

 The reason is that before adding the base classes there is no check if the
 base class is indeed a django model:

 
https://github.com/django/django/blob/master/django/db/migrations/autodetector.py#L495-505

 Solution: Check if the base class is an instance of django.db.model before
 adding it.

 Context:

 I have Models with some mixins that just add method and functionality that
 is shared among multiple models, e.g. an InvoiceMixin, that is shared by
 multiple models to enrich them with convenience methods.

--
Ticket URL: <https://code.djangoproject.com/ticket/23574>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.0bb98be71b7def2f0a1ac01a05951785%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to