我有一个模型定义如下:
class Artist(models.Model):
"""Model class to record Artist"""
artist_name = models.CharField(max_length=200)
artist_id = models.CharField(unique=True, max_length=50)
# similar relationship is defined.
related_to = models.ManyToManyField("self", null=True, blank=True)
def __unicode__(self):
return self.artist_name
当我对 django 管理面板中的艺术家使用“删除”管理操作时,我得到:
Artist: trojan
From_artist-to_artist relationship: Artist_related_to object
From_artist-to_artist relationship: Artist_related_to object
From_artist-to_artist relationship: Artist_related_to object
From_artist-to_artist relationship: Artist_related_to object
Artist: betty
From_artist-to_artist relationship: Artist_related_to object
From_artist-to_artist relationship: Artist_related_to object
我如何获得在删除期间被警告的实际关系?
换句话说,如何将“Artist_related_to object”人性化以反映实际的艺术家姓名。