﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32317	Clean up loaddata	William Schwartz	William Schwartz	"In `django.core.management.commands.Command`, `load_label` is 66 lines long with maximum indentation of 9 levels (the row starts at column 37). `find_fixtures` is 56 lines. These monolith methods are hard to read, hard to override, and, in some places, violate [https://www.python.org/dev/peps/pep-0008/#programming-recommendations PEP-8's recommendation] to keep `try` blocks small.

The reason I care about this is that an app I'm working on may need to customize how `loaddata` finds fixtures, and, unlike templates, there isn't a nice loader API to hook into. So that leaves me with overriding `find_fixtures`. My initial attempt was a mess because of how giant the parent class's method is.

I am submitting [https://github.com/django/django/pull/13842 PR GH-13842] with my proposed refactoring. The commits will need to be squashed before merging the PR, but I wanted to include commit message to justify some of the less obvious-looking changes."	Cleanup/optimization	assigned	Core (Management commands)	dev	Normal		loaddata		Unreviewed	0	0	0	0	0	0
