Search code examples
pythonpython-3.xdjangodjango-modelsunsigned-integer

0 value in Django PositiveIntegerField?


Can a field of type models.PositiveIntegerField contain a 0 value? I'm doing something like:

points = models.PositiveIntegerField()

Thanks,

I know I should try it myself, but I haven't a Django environment here.


Solution

  • Yes, it can. It is debatable whether it should--there is a longstanding bug report: http://code.djangoproject.com/ticket/7609