code: def thumb(self, obj):
          
          format, created = Format.objects.get_or_create(name='newman_thumb',
                                                         defaults={
              'max_width': 100,
              'max_height': 100,
              'flexible_height': False,
              'stretch': False,
              'nocrop': True,
          })
  
          if created:
              format.sites = Site.objects.all()
  
          info = obj.get_formated_photo(format)
  
          return '<a href="%(href)s"><img src="%(src)s"></a>' % {
              'href': '%s/' % obj.pk,
              'src': info['url']
          }
docs: Generates html and thumbnails for admin site.