I’m looking to the best way to overriding the _get_url method from ImageField, I need to customize the url since I don’t want the default returned url (I distribute this image trhough a view to manage ACL on it so the url based on the MEDIA_ROOT is wrong).
Should I have to create my own ImageField ? or is there a solution using less code ?
Thanks in advance
Fabien
The url returned be
_get_urlis actually generated by the used Storage class; it would probably make more sense to create your own Storage and use it when creating theImageField!See: http://docs.djangoproject.com/en/dev/topics/files/#file-storage, http://docs.djangoproject.com/en/dev/howto/custom-file-storage/
You will neet to override the
Storage.urlmethod for that!