The Python Oracle

How to limit the maximum value of a numeric field in a Django model?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 5 Looping

--

Chapters
00:00 Question
00:55 Accepted answer (Score 144)
02:21 Answer 2 (Score 490)
02:59 Answer 3 (Score 104)
03:12 Answer 4 (Score 57)
03:28 Thank you

--

Full question
https://stackoverflow.com/questions/8491...

Question links:
[DecimalField]: http://docs.djangoproject.com/en/dev/ref...
[PositiveIntegerField]: http://docs.djangoproject.com/en/dev/ref...
[has been closed]: http://code.djangoproject.com/ticket/684...

Accepted answer links:
http://docs.djangoproject.com/en/dev/how...

Answer 2 links:
[Django's built-in validators]: https://docs.djangoproject.com/en/dev/re...
[full_clean]: https://docs.djangoproject.com/en/2.2/re...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #django #djangomodels #djangovalidation

#avk47