def METHOD_NAME(self):
    inline_content_types = getattr(
        settings, "WAGTAILDOCS_INLINE_CONTENT_TYPES", ["application/pdf"]
    )
    if self.content_type in inline_content_types:
        return "inline"
    else:
        return "attachment; filename={0}; filename*=UTF-8''{0}".format(
            urllib.parse.quote(self.filename)
        )