我有:
class Item(models.Model):
# some fields like name, quantity
def get_first_image(self):
instance = ItemImage.objects.filter(parent_id = self.id)[0]
return instance.images
class ItemImage(models.Model):
# parent with foreignkey to Item and an ImageField to store images
如何使用 sweetpie 检索 get_first_image 的值?