This has already been answered here:
How to find length of digits in an integer?
Essentially, you first convert the integer to a string and then get the length of the string.
So in your view, you will need to have some logic like this:
tnum_length = len(str(tnum))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…