Opened 18 years ago
Closed 18 years ago
#6436 closed (fixed)
loaddata can load fixture data multiple times, if specified with absolute pathname
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Keywords: | loaddata absolute pathname | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Attached patch includes a regression test that demonstrates issue, along with a proposed fix (for review).
The situation can arise if a project has a test fixture that is maintained outside of the project structure. An attempt to load the fixture with an absolute path, e.g.
python manage.py loaddata /path/to/fixture
will work, but consumes more time and memory than necessary, since the fixture data will be loaded once for every fixture directory in a project (in either an installed application or FIXTURE_DIRS).
This effect can be observed in the count of objects and fixtures that are reported by the loaddata command. Setting '--verbosity=2' makes it more apparent.
Attachments (1)
Change History (3)
by , 18 years ago
| Attachment: | loaddata_absolute_20080121a.diff added |
|---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Regression test and proposed fix