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 27880,Use __set_name__ to replace some usages of contribute_to_class.,Simon Charette,nobody,"If we were to define [https://docs.python.org/3.6/reference/datamodel.html#object.__set_name__ __set__name__] calling `contribute_to_class()` on `models.Field`, `Manager` and `Options` the following things could be done: 1. `ModelBase.add_to_class` calls could be replaced by simple `setattr(cls, name, value)`. 2. `Options.contribute_to_class` could be inlined in `Options.__set_name__`. 3. `Manager.contribute_to_class` could be inlined in `Manager.__set_name__`. 4. There might be a way to inline `Field.contribute_to_class` by dealing with its `private_only` flag somehow.",Cleanup/optimization,new,"Database layer (models, ORM)",dev,Normal,,python3.6,,Accepted,0,0,0,0,0,0