Django - input octal for integer -


i've got model includes integer field holds octal numbers. have modelform associated model. want make user can enter number form in octal. there nice way of doing in django?

note sure of mean

integer field holds octal numbers

that's integer, if want user give octal values. unless store string ?

one way use charfield regexp validation (like [0-7]+), , callback <field>_validate (using isnumeric() check correct number).

you can write custom field: https://docs.djangoproject.com/en/1.8/howto/custom-model-fields/


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -