I have the following in my app:
class University(models.Model):
...
sister_university = models.OneToOneField('self',
related_name =
'university_sister_university',
blank=True, null=True,
on_delete=models.SET_NULL)
As it is, under the Django Admin site, I’m able to select University A as the sister_university of University A (itself). Is it possible to enforce some sort of a rule at the database level so a university object can never be its own sister_university?
Alternatively, is there a better way of accomplishing what I’m trying to do?