  
  @python_2_unicode_compatible
  class Inventory(models.Model):
      barcode = models.PositiveIntegerField(unique=True)
      parent = models.ForeignKey('self', to_field='barcode', blank=True, null=True)
      name = models.CharField(blank=False, max_length=20)
      hidden = models.BooleanField(default=False)
  
      # see #9258
      default_manager = models.Manager()
 
</s> remove     parent = models.ForeignKey('self', null=True, blank=True, related_name='children')
 </s> add     parent = models.ForeignKey('self', models.SET_NULL, null=True, blank=True, related_name='children') </s> remove     alfa = models.ForeignKey(Alfa, null=True)
    bravo = models.ForeignKey(Bravo, null=True)
 </s> add     alfa = models.ForeignKey(Alfa, models.SET_NULL, null=True)
    bravo = models.ForeignKey(Bravo, models.SET_NULL, null=True) </s> remove     parent = models.ForeignKey('self', null=True)
 </s> add     parent = models.ForeignKey('self', models.CASCADE, null=True) </s> remove         parent = models.ForeignKey(RangesModel, blank=True, null=True)
 </s> add         parent = models.ForeignKey(RangesModel, models.SET_NULL, blank=True, null=True) </s> remove     related = models.OneToOneField(RelatedModel)
 </s> add     related = models.OneToOneField(RelatedModel, models.CASCADE)
    parent = models.ForeignKey('self', models.SET_NULL, to_field='barcode', blank=True, null=True)
  
  @python_2_unicode_compatible
  class Inventory(models.Model):
      barcode = models.PositiveIntegerField(unique=True)
    parent = models.ForeignKey('self', models.SET_NULL, to_field='barcode', blank=True, null=True)
      name = models.CharField(blank=False, max_length=20)
      hidden = models.BooleanField(default=False)
  
      # see #9258
      default_manager = models.Manager()
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_widgets/models.py