#24514: Unused import on some auto generated migrations
-------------------------------------+-------------------------------------
     Reporter:  hugotacito           |      Owner:  nobody
         Type:                       |     Status:  new
  Cleanup/optimization               |
    Component:  Migrations           |    Version:  1.7
     Severity:  Normal               |   Keywords:  unused import
                                     |  migrations
 Triage Stage:  Unreviewed           |  Has patch:  0
Easy pickings:  0                    |      UI/UX:  0
-------------------------------------+-------------------------------------
 Some auto generated migrations don't use '''django.db.models'''.
 Especially those that only change the Meta class. It would be nice to
 change the '''django.db.migrations.writer.MIGRATION_TEMPLATE''' to only
 add the '''from django.db import models''' if its really needed.

 Example of auto generated migration with unused import:

 {{{
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals

 from django.db import models, migrations


 class Migration(migrations.Migration):

     dependencies = [
         ('city', '0003_auto_20150305_0928'),
     ]

     operations = [
         migrations.AlterModelOptions(
             name='city',
             options={'verbose_name': 'City', 'verbose_name_plural':
 'Cities'},
         ),
     ]

 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24514>
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/053.665f74a7c6201f1d3abe2b0a4021ccf5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to