1
class MyModel(models.Model):
    ...
    original_image = models.ImageField(upload_to=upload_image_to)

    thumbnail = ImageSpecField(
        processors=thumbnail_processors,
        source='original_image',
        format='PNG'
    )
    ...

obj = MyModel()
val = getattr(obj, 'thumbnail')

... this gives me the following error: "TypeError: can't pickle instancemethod objects"

Django 1.7.1
ImageKit 3.2.4

demux
  • 4,544
  • 2
  • 32
  • 56
  • Possible duplicate: http://stackoverflow.com/questions/2049849/why-cant-i-pickle-this-object – dursk Dec 02 '14 at 02:56
  • Why dont you do: val = obj.thumbnail ? – doniyor Dec 02 '14 at 05:51
  • @doniyor, this code is just to demonstrate the problem. I need to be able to dynamically access attributes of the instance. My code goes through a list of attributes per instance in a list of instances. – demux Dec 02 '14 at 14:55

0 Answers0