I have a url field in 3 different models is there any pre defined way in rest framework or django so that they will be unique across multiple models?? or i have to write the whole unique thing logic manually?? and also these fields/models are not related to each other in any way not through foreignkey, manytomany or onetoone. They are diffrent models in which field names are same.
class City(models.Model):
url = models.CharField() # Eg abc.com/indore
class State(models.Model):
url = models.CharField() # Eg abc.com/madhya-pradesh
class Country(models.Model):
url = models.CharField() # Eg abc.com/india
eg: A url used in a City object should not be used in any State and country objects as well