0
我:Django的tastypie包括高清從模型屬性的一個資源上
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
我怎樣才能檢索使用tastypie的get_first_image的價值?