﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21238	`ImageFieldFile.url` raises an AttributeError exception after retrieving it from cache	Pierre Dulac	Hasan Ramezani	"Hi everyone,

To reproduce the exception, just cache an instance of `ImageFieldFile` then retrieve it and call the `url` property on this retrieved instance.

Here is a minimal code to reproduce : 

{{{
from django.core.cache import cache
from django.db import models

class A(models.Model):
    pictogram = models.ImageField(upload_to='images')
    class Meta:
        app_label = 'test'

a = A()
a.pictogram = 'fake/test/url.png'
original_picto = a.pictogram

cache_key = 'picto'
cache.set(cache_key, original_picto, 60)
cached_picto = cache.get(cache_key)

print original_picto.url
print cached_picto.url
}}}

and you get 

{{{
AttributeError: 'ImageFieldFile' object has no attribute 'storage'
}}}

Didn't tried to fix it yet...

Have a nice day,

Pierre"	Bug	closed	Core (Cache system)	dev	Normal	fixed	imagefield, cache	sky.kok@… lucmult@…	Ready for checkin	1	0	0	0	0	0
