SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.38k stars 318 forks source link

using templatetag with as don't put full url #60

Closed ebertti closed 13 years ago

ebertti commented 13 years ago

When I use {% thumbnail photo 20x20 as thumb %}

and render this thumb like {{ thumb }} the path come without MEIDA_URL, to fix this, go in line 89 of templatatag/thumbnail.py

do this change

 if self.context_name is None:
     return escape(thumbnail.url)
 else:
     context[self.context_name] = escape(thumbnail.url)
     return ''
SmileyChris commented 13 years ago

This is actually by design. The template then has access to the ThumbnailFile and it's methods, as described here: http://packages.python.org/easy-thumbnails/ref/files.html#easy_thumbnails.files.ThumbnailFile

I have opened issue #61 to track better documenting this though. If you want to spend some time writing it, it'd be appreciated ;)