How to determine the maximum integer the model can handle?
Posted
by John Mee
on Stack Overflow
See other posts from Stack Overflow
or by John Mee
Published on 2010-03-18T13:31:01Z
Indexed on
2010/03/18
13:31 UTC
Read the original article
Hit count: 442
django
|django-models
"What is the biggest integer the model field that this application instance can handle?"
We have sys.maxint, but I'm looking for the database+model instance. We have the IntegerField, the SmallIntegerField, the PositiveSmallIntegerField, and a couple of others beside. They could all vary between each other and each database type.
I found the "IntegerRangeField" custom field example here on stackoverflow. Might have to use that, and guess the lowest common denominator? Or rethink the design I suppose.
Is there an easy way to work out the biggest integer an IntegerField, or its variants, can cope with?
© Stack Overflow or respective owner