code: def get_filename(self):
          
          if self.filename is None:
              name = splitext(basename(self.template_name))[0]
              return '{}.pdf'.format(name)
  
          return self.filename
docs: Return ``self.filename`` if set otherwise return the template basename with a ``.pdf`` extension.
  
          :rtype: str