I have the following model:
class Category(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self', related_name='children')
My question is that how I could prevent model to referencing itself (same object). Object should be only able to point to other categories but not to itself ('dogs' can have parent 'animals' but can't have parent 'dogs')