﻿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
35623	Document that fields cannot be named 'check'	Francisco Camerini	Mohammad Salehi	"I've been tasked with migrating a large codebase from Django 3.2 to 4.2.

Upon updating to 4.0, I noticed that the [https://docs.djangoproject.com/en/5.0/ref/checks/#:~:text=models.E020%3A%20The%20%3Cmodel%3E.check()%20class%20method%20is%20currently%20overridden.models.E020 models.E020] system check was being triggered.

This project has had multiple models with ""check"" fields for many years. This error was not being triggered before 4.0 because class methods were protected from being overwritten by fields. This behavior [https://github.com/django/django/commit/225d96533a8e05debd402a2bfe566487cc27d95f#diff-35c61cb049d39b2e890f12f8c1f9583fb8ca351a8495718b5375a7120f775d05L785-R785 was changed here]

[https://github.com/django/django/commit/a5c77417a651c93036cf963e6da518653115be7e This commit's message] is very explicit about ""check"" being a reserved word that cannot be redefined as anything else other than a method. However, the [https://docs.djangoproject.com/en/5.0/topics/db/models/#field-name-restrictions documentation on field name restrictions] is silent about that, only stating that:

- A field name cannot be a Python reserved word, because that would result in a Python syntax error.
- A field name cannot contain more than one underscore in a row, due to the way Django’s query lookup syntax works.
- A field name cannot end with an underscore.

For now I've silenced the models.E020 error, but this is far from ideal, what would be the best way to still run all model system checks without having to change our models to use a different field name?
"	Cleanup/optimization	closed	Core (System checks)	4.0	Normal	fixed	models.E020		Ready for checkin	1	0	0	0	0	0
