def dehydrate_product_brand(self, obj): in django code example Example: str django def __str__(self): return self.name