#8405: Editing inline-image in admin results in KeyError
---------------------------------------------------------+------------------
 Reporter:  Uninen                                       |       Owner:  nobody 
   
   Status:  new                                          |   Milestone:         
   
Component:  Admin interface                              |     Version:  SVN    
   
 Keywords:  inheritance modelinheritance admin keyerror  |       Stage:  
Unreviewed
Has_patch:  0                                            |  
---------------------------------------------------------+------------------
 I have three models:

 {{{

 class Image(models.Model):
     image = models.ImageField(upload_to='productimages/')

 class ExtraImage(Image):
     model = models.ForeignKey('ProductModel')

 class ProductModel(models.Model):
     modelnumber = models.CharField(primary_key=True, max_length=50,
 unique=True)

 }}}

 and admin interface for them, which has a inline for the extra images:

 {{{

 class ExtraImageInline(admin.TabularInline):
     model = ExtraImage
     extra = 2

 class ProductModelAdmin(admin.ModelAdmin):
     inlines = (ModelPropertyInline, ExtraImageInline)

 }}}

 Adding the image works OK, but anything after that (editing or deleting)
 results in KeyError:

 {{{
  File "/home/customer/django/django/forms/models.py", line 292, in
 save_existing_objects
    obj = existing_objects[form.cleaned_data[self.model._meta.pk.attname]]

 KeyError: 'image_ptr_id'
 }}}

 Tested with dev server with Django r8435 and apache+mod_python running
 Django r8355.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8405>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to