Open BeritJanssen opened 3 months ago
null=False
is also the default value, so this isn't really needed.null = False
and blank = True
), ''
is already the default, so you don't need to set it explicitly.validate_field_language
also accepts ''
, but the logic is a bit odd because it calls validate_language_code
which is also used elsewhere. I agree a docstring would be a good addition.
- For CharFields (at least with
null = False
andblank = True
),''
is already the default, so you don't need to set it explicitly.
Ah! So that's indeed a default. Hadn't stumbled upon that yet in the Django documentation. I do think that if we are to explicitly state values, blank=True, default=''
is more readable.
The
language
field of theField
model looks strange to me: It has aCharField
withblank=True, null=False
. So then we should set a default, I believe? NBnull=False
is not necessary to state explicitly (and it's not advised to set this toTrue
onCharField
s anyway).validate_field_language
seems to assume that fields which don't have an explicit language tag set would have to have "dynamic" set. I'm not sure I agree with enforcing that every field, or for "dynamic", the corpus, has a valid language tag, in some corpora we simply don't have that kind of metadata. A docstring invalidate_field_language
about the meaning of the "dynamic" setting may also not be misplaced.