On Wed, 2009-03-04 at 22:17 -0800, liangent wrote: > I created a ImageField img_field with height_field parameter in a > model, > added an image, then get it from database. > > If I try to access obj.img_field.height and obj.img_field.width, > where do django get this data from? > > Cached data when SELECTed from db? > Or get size with PIL then cache it?
The value is computed (using PIL) when the image is first saved and then saved in the database. So, after that first time, the values are simply loaded each time you retrieve the record. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---