Changes between Initial Version and Version 2 of Ticket #22577


Ignore:
Timestamp:
May 5, 2014, 6:18:28 AM (10 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22577 – Description

    initial v2  
    11When the migration folder does not have an init
    2 http://codepad.com/U2nGptor
     2http://codepad.org/U2nGptor
    33{{{
    44
    5 File "/home/archie/git/django/django/db/migrations/writer.py", line 150, in path basedir = os.path.dirname(migrations_module.__file__) AttributeError: 'module' object has no attribute '__file__'
     5File "/home/archie/git/django/django/db/migrations/writer.py", line 150, in path basedir = os.path.dirname(migrations_module.__file__)
     6AttributeError: 'module' object has no attribute '__file__'
    67
    78}}}
    89
    9 the problem lies with makemigrations.py line 134-36 they are checking to see if an init file exists in the migrations dir but it checks using  a line that depends on the existence of __init__.py. line 130 , writer.path, following to see where this code comees from led me to line149 and 150 which need there to be an init file for __file__ to be an attribute there ..
     10the problem lies with `makemigrations.py` line 134-36 they are checking to see if an init file exists in the migrations dir but it checks using  a line that depends on the existence of `__init__.py`. line 130 , `writer.path`, following to see where this code comes from led me to line 149 and 150 which need there to be an init file for `__file__` to be an attribute there ..
    1011tl;dr
    11 makemigrations checks for an init file using os.path.isdir but with a call that depends on an __init__.py for it treats it as a module before it knows if it is a module
     12`makemigrations` checks for an init file using `os.path.isdir` but with a call that depends on an `__init__.py` for it treats it as a module before it knows if it is a module
Back to Top