﻿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
24210	Clean up relational fields __init__ args/kwargs.	Loic Bistuer	Loic Bistuer	"Relational `Field` and `Rel` have complex constructors with many arguments that are dug out of `**kwargs` rather than defined declaratively.

For example:

{{{
    def __init__(self, to, db_constraint=True, swappable=True, **kwargs):
        kwargs['verbose_name'] = kwargs.get('verbose_name', None)
        kwargs['rel'] = ManyToManyRel(
            self, to,
            related_name=kwargs.pop('related_name', None),
            related_query_name=kwargs.pop('related_query_name', None),
            limit_choices_to=kwargs.pop('limit_choices_to', None),
            symmetrical=kwargs.pop('symmetrical', to == RECURSIVE_RELATIONSHIP_CONSTANT),
            through=kwargs.pop('through', None),
            through_fields=kwargs.pop('through_fields', None),
            db_constraint=db_constraint,
        )
}}}

This makes it difficult to audit and comprehend and has already resulted in bugs, (e.g. migrations omitting  to handle some of the arguments in `deconstruct()`)."	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
