3 ms·
Regarding 2: even if it has been documented for a while, I don't think it's very widely known. I still see a lot of models.CharField(max_length=x) in Djan
by Jonanin 13y ago
Regarding 2: even if it has been documented for a while, I don't think it's very widely known. I still see a lot of
models.CharField(max_length=x)
in Django code, where x is usually an arbitrary value only chosen because CharField requires it.
- tcdent 13y agoProbably a result of supporting multiple backends. AFAIR, MySQL requires a length to be passed on VARCHAR.
- falcolas 13y agoYes, because varchar is implemented as a fixed-length list of characters. Text fields are implemented as blobs, and as such can grow large enough to have to be stored off-page (with all of the associated performance hits associated with that).