
    3~h+                     0    d dl mZ d dlmZ  G d d      Zy)    )render_to_string)gettext_lazyc                   2    e Zd ZdZ ed      ZdZddZd Zy)AdminThumbnailzU
    A convenience utility for adding thumbnails to Django's admin change list.

    	ThumbnailTNc                      || _         || _        y)z
        :param image_field: The name of the ImageField or ImageSpecField on the
            model to use for the thumbnail.
        :param template: The template with which to render the thumbnail

        N)image_fieldtemplate)selfr	   r
   s      W/var/www/peopleoo.sandbox-dev.co.uk/venv/lib/python3.12/site-packages/imagekit/admin.py__init__zAdminThumbnail.__init__   s     '     c                 Z   t        | j                        r| j                  |      }n	 t        || j                        }t        |dd       xs |}| j                  xs d}t        ||||d      S # t        $ r1 t	        d| j                  d|j
                  j                  d      w xY w)NzThe property z is not defined on .sourcezimagekit/admin/thumbnail.html)model	thumbnailoriginal_image)	callabler	   getattrAttributeError	Exception	__class____name__r
   r   )r   objr   r   r
   s        r   __call__zAdminThumbnail.__call__   s    D$$%((-ID#C)9)9:	
 !Hd;Hy==C$C",+
  	 " D))3==+A+A!C D DDs   A0 0:B*)N)	r   
__module____qualname____doc___short_description
allow_tagsr   r    r   r   r   r      s"     +J!r   r   N)django.template.loaderr   django.utils.translationr   r    r   r#   r   r   <module>r&      s    3 6# #r   