def _file(self, obj): file = None if obj: file = obj.file return create_image_thumbnail_dict(self.context["request"], file, fit_large=False)
def _avatar(self, instance): placeholder = self.context["request"].build_absolute_uri( static("members/images/default-avatar.jpg") ) file = None if instance.member and instance.member.profile.photo: file = instance.member.profile.photo return create_image_thumbnail_dict( self.context["request"], file, placeholder=placeholder, size_large="800x800" )