#22788: Custom migration operations are rewritten incorrectly
----------------------------+------------------------------------
     Reporter:  schinckel   |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  master
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Accepted
    Has patch:  1           |      Needs documentation:  0
  Needs tests:  1           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+------------------------------------

Comment (by schinckel):

 The issue I have hit with this relates only to the django test framework.

 Basically, the tests for this part live in the top-level 'migrations'
 package (when running the tests). Defining an operation within this
 package conflicts with the import in _every_ migrations file:

     from django.db import migrations

 This means I've had to import the custom operation directly (i.e., not
 namespaced).

 Which then in turn means you cannot have two migration operations with the
 same name (that are actually different classes).

 That is, I can import the `foo.operations.Operation` and `bar.Operation`
 in a normal situation, but can't actually write a passing test in the
 normal django test system.

 I could mangle the names on import "from foo.operations import Operation
 as foo_operations_Operation", but this seems messy.

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

Reply via email to