Making sure a field is always null in Django
问题 I have a parent class which is being extended by 3 different models. The parent class has a field called foo lets say, and this field needs to be always null for one of the sub-classes. How can I ensure this? Right now, I am using null=True , and editable=False constraints. However, these can be circumvented from the shell or an API if the field is exposed during object creation. class ThirdSubclass(ParentClass): # Over-ridden field from abstract parent class foo = models