Changes between Initial Version and Version 2 of Ticket #22577
- Timestamp:
- May 5, 2014, 6:18:28 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22577 – Description
initial v2 1 1 When the migration folder does not have an init 2 http://codepad. com/U2nGptor2 http://codepad.org/U2nGptor 3 3 {{{ 4 4 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__' 5 File "/home/archie/git/django/django/db/migrations/writer.py", line 150, in path basedir = os.path.dirname(migrations_module.__file__) 6 AttributeError: 'module' object has no attribute '__file__' 6 7 7 8 }}} 8 9 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 ..10 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 comes from led me to line 149 and 150 which need there to be an init file for `__file__` to be an attribute there .. 10 11 tl;dr 11 makemigrations checks for an init file using os.path.isdir but with a call that depends on an __init__.pyfor it treats it as a module before it knows if it is a module12 `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