diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-12-05 22:55:33 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-12-07 10:47:34 +0100 |
| commit | 41ebc4838d2b09e7f3ece8889e21492902b55dc8 (patch) | |
| tree | 7526acc903e1f00353ae38e7d4d132ba871fb854 /django | |
| parent | 8a9c8bb90736451e6bdea82723cbb23a695146fb (diff) | |
Fixed #21551 -- Reenabled loading fixtures from subdirectory
This was a regression in Django 1.6 that was only partially
restored in 839940f27f.
Thanks Jonas Haag for the report.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/loaddata.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index 667fbbf493..59c1343271 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -178,11 +178,15 @@ class Command(BaseCommand): if self.verbosity >= 2: self.stdout.write("Loading '%s' fixtures..." % fixture_name) - if os.path.sep in fixture_name: + if os.path.isabs(fixture_name): fixture_dirs = [os.path.dirname(fixture_name)] fixture_name = os.path.basename(fixture_name) else: fixture_dirs = self.fixture_dirs + if os.path.sep in fixture_name: + fixture_dirs = [os.path.join(dir_, os.path.dirname(fixture_name)) + for dir_ in fixture_dirs] + fixture_name = os.path.basename(fixture_name) suffixes = ('.'.join(ext for ext in combo if ext) for combo in product(databases, ser_fmts, cmp_fmts)) |
