Django restrict input in the admin -
i'm wondering how can retrict input of field in admin numbers , max of 10 digits. "max of 10 digits" part confusing.
the model field one:
id_student = models.positiveintegerfield(primary_key=true)
how can make sure in admin gets max of 10 digits? i'm kind of lost in docs , imagining weird ways achieve this, bet there simple way.
edit
tried adding max_length=10
, doesn't work:
id_student = models.positiveintegerfield(primary_key=true, max_length=10)
i think max_length=10
should trick you.
Comments
Post a Comment