def get_filename(self, instance):
filename = self.field.getFilename(instance)<EOL>if filename:<EOL><INDENT>return filename<EOL><DEDENT>fieldname = self.get_field_name()<EOL>content_type = self.get_content_type(instance)<EOL>extension = mimetypes.guess_extension(content_type)<EOL>return fieldname + extension<EOL>
Get the filename