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的价值?