I'm trying to set a default value for the integer field in Django model using
models.PositiveSmallIntegerField(default='0')
Why isn't it working?
The default value in your example is set to string ('0'
), but it should be integer. Try this instead:
models.PositiveSmallIntegerField(default=0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With