Export to GitHub

django-photologue - issue #91

Suggestion: stop using get_SIZE_url as the method names


Posted on Dec 16, 2008 by Happy Ox

This caused a HUGE confusion in #django recently (and I could see it happening elsewhere), as everyone logically assumed the user's issue was in trying to use the old, outdated, get_imagefield_url method on an object, when instead it was your magic hacking for get_SIZE_url, using the same format as the now non-existent methods in django

Comment #1

Posted on Dec 16, 2008 by Happy Giraffe

This is already on my list for version 3 and I'll mark it as such. Thanks.

Comment #2

Posted on Dec 16, 2008 by Happy Giraffe

(No comment was entered for this change.)

Comment #3

Posted on Dec 24, 2008 by Massive Panda

as a temporary workaround, I did something like this:

class Picture(photologue.models.ImageModel) : def init(self, *args, **kwargs): self.sized_image=ImageSizeAccessor() self.sized_image._parent = self super(Picture, self).init(*args, **kwargs)

class ImageSizeAccessor(object): """ convenient argument-free image size access for templates through the sized_image attribute """ def getitem(self, key): return { 'size': getattr(self.parent, 'get%s_size' % key)(), 'url': getattr(self.parent, 'get%s_url' % key)(), 'filename': getattr(self.parent, 'get%s_filename' % key)(), # 'photosize': getattr(self.åparent, 'get%s_photosize' % key), }

HTH

Comment #4

Posted on Feb 10, 2009 by Massive Dog

Comment deleted

Status: Accepted

Labels:
Milestone-3.0