django-models-4

Last Updated :
Discuss
Comments

Which Django field type is used when a model needs to store only non-negative whole numbers and must prevent any negative values?

PositiveIntegerField() – Stores integers that are zero or greater

BigIntegerField() – Supports very large signed integers, including negatives

SmallIntegerField() – Allows both positive and negative small integers

DecimalField() – Stores decimal values with fixed precision

Tags:
Share your thoughts in the comments