name) except (ValueError, TypeError): e.add(opts, '"%s": CharFields require a "max_length" attribute that is a positive integer.' % f.name) It should be changed to something this: if isinstance(f, models.CharField) and f.max_length is not None: ... The FileField does not ...
required_kind: raise ValueError(f"kind != {cls.required_kind!r}") return v class A(BaseKind): required_kind: ClassVar[str] = "a" foo: str = "yolo" class B(BaseKind): required_kind: ClassVar[str] = "b" bar: str = "rolo" class C(BaseModel): results: Union[A, B] print(C...