How to store an integer leaded by zeros in django

Posted by Oscar Carballal on Stack Overflow See other posts from Stack Overflow or by Oscar Carballal
Published on 2010-06-18T13:28:49Z Indexed on 2010/06/18 13:33 UTC
Read the original article Hit count: 420

Hello,

I'm trying to store a number in django that looks like this:

000001

My problem is that if I type this inside an IntegerField it gets converted to "1" without the leading zeros. I've tried also with a DecimalField with the same result. How can I store the leading zeros whithout using a CharField? (I need to manipulate that number in it's integer form)

© Stack Overflow or respective owner

Related posts about python

Related posts about django