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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -