'Django Limit the Number of objects in a model

i am working on a django-cms project and (i have to make a image model which can only make 3 objects not more than that if someone tries there should be a message: Max Objects Have been Created) so, how can i limit the number of objects in a model ? Thank you, I will Really appreciate you feedback.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source