Django set range for integer model field as constraint

后端 未结 4 1223
误落风尘
误落风尘 2020-12-15 15:51

I have a django model,

class MyModel(models.Model)
    qty = model.IntegerField()

where I want to set constraint for qty somet

4条回答
  •  感动是毒
    2020-12-15 16:17

    If you are using postgres, you can use range fields to specify the range. Check this: Range Fields in django

提交回复
热议问题