#3601: ImageField and db_column don't do well -----------------------------+---------------------------------------------- Reporter: [EMAIL PROTECTED] | Owner: adrian Status: new | Component: Admin interface Version: SVN | Keywords: ImageField Stage: Unreviewed | Has_patch: 1 -----------------------------+---------------------------------------------- Hi, I seem to have stumbled upon a bug with ImageField. Here are the steps to reproduce : * define a model with an ImageField that has a db_column attribute that is different from his attribute name * add an object of this class using the admin * try to access the change_form of this object again and you should see a KeyError If I understand correctly, the problem is located at line 136 of django/contrib/admin/view/main.py where we try to access self.original.__dict__[self.field.column], which doesn't exist. My patch simply return self.original.__dict__[self.field.attname] instead. Please note that this hasn't been extensively tested and I really don't have the needed time to add unit tests.
-- Ticket URL: <http://code.djangoproject.com/ticket/3601> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
