Often people use a …Model suffix for their model, for example:
from django.db import models
class CarModel(models.Model):
# …
passWhy is it a problem?
Because objects from a model are not models, these are cars, not car models. Django will also construct verbose named based on the name of the class. Indeed, unless you specify verbose_name [Django-doc] and verbose_name_plural [Django-doc] yourself, Django will "unsnake" the name and thus give a verbose name like:
>>> CarModel._meta.verbose_name
'car model'
>>> CarModel._meta.verbose_name_plural
'car models'This thus means that Django will ask questions in the model admin like:
Are you sure you want to remove this car model?
What can be done to resolve the problem?
Remove the …Model suffix. Django models are not supposed to have a …Model suffix, so:
from django.db import models
class Car(models.Model):
# …
pass