def get_media(self, obj): return MediaEntitiesSerializer(obj.get_media_filter( type=MediaEntities.TYPE_IMAGE, sub_type=[ MediaEntities.SUB_TYPE_BANNER, MediaEntities.SUB_TYPE_LOGO ]), many=True).data
def get_media(self, obj): return MediaEntitiesSerializer(obj.get_media_filter( type=MediaEntities.TYPE_IMAGE, sub_type=MediaEntities.SUB_TYPE_SPONSORS_LOGO), many=True).data
def get_media(self, obj): mobjs = obj.media.all().generic_objects() data = MediaEntitiesSerializer(mobjs, many=True).data return data
def get_media(self, obj): return MediaEntitiesSerializer(obj.get_sub_entities_of_type( BaseEntity.SUB_ENTITY_MEDIA), many=True, context=self.context).data