#36813: Convert system checks for max_length and max_digits to __init__() 
checks.
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  Mehraz
         Type:                       |  Hossain Rumman
  Cleanup/optimization               |                   Status:  assigned
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

 I like that rule of thumb and it seems coherent with your initial request

 > I am suggesting that for simple checks on `isinstance` and `> 0` that we
 could error out in `{Char,Decimal}Field.__init__` instead of via a system
 check, to catch additional usage mistakes.

 I guess it's kind of a mitigative measure to our lack of type hints usage.

 Anything that is somehow database dependent should be performed at check
 and compilation time though.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36813#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019b6ab3efb3-fad36f3e-f4c8-4234-84f0-ce3a093d8b09-000000%40eu-central-1.amazonses.com.

Reply via email to