﻿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
14949	"Admin inlines not saving on ""Save As New"""	Paul Bailey	nobody	"I have an admin class that has 3 inlines (code below).  When using the ""Save as New"" button the inlines are not saved under certain circumstances.  The conditions that cause the problem are as follows.  Usually one the inlines has no data which is expected.  If you enter data for an inline that was not previously used then data is not saved on ""Save as new"".  If there was data previously entered and you just change that inline then everything works fine.  The data in the previously unused inlines is also not validated because you can enter bad data and no error messages are returned.  So the data is just ignored altogether for some reason.  Will attach some screen shots shortly.

{{{
class EPAdmin (admin.TabularInline):
  model = hp_models.EditorsPick
  extra = 5
  max_num = 5
  raw_id_fields = ('event', 'clist', 'news', 'place', 'best')
  can_delete = False
  readonly_fields = ('crop',)
  
  fieldsets = (
        (None, {
            'fields': ('label', 'event', 'clist', 'news', 'place', 'best', 'iorder', 'crop')
        }),)
        
class ThreadAdmin (admin.TabularInline):
  model = hp_models.Thread
  extra = 5
  max_num = 7
  raw_id_fields = ('event', 'clist', 'news', 'place', 'best')
  readonly_fields = ('crop',)
  
  fieldsets = (
        (None, {
            'fields': ('event', 'clist', 'news', 'place', 'best', 'iorder', 'crop')
        }),)
        
class ThreadPlusAdmin (admin.TabularInline):
  model = hp_models.ThreadPlus
  extra = 2
  max_num = 2
  raw_id_fields = ('event', 'clist', 'news', 'place', 'best')
  can_delete = False
  
  fieldsets = (
        (None, {
            'fields': ('event', 'clist', 'news', 'place', 'best', 'iorder')
        }),)
        
class EPModuleAdmin (admin.ModelAdmin):
  inlines = (EPAdmin, ThreadAdmin, ThreadPlusAdmin)
  list_filter = ('publish', 'modtype')
  list_display = ('publish', 'modtype', 'clone', 'preview')
  save_as = True
  raw_id_fields = ('thread_photo',)
  readonly_fields = ('thread_crop',)
  
  class Media:
    js = (""javascript/jquery/jquery-1.3.2.js"", ""rd/js/admin/genericmodule.js"",)

}}}
"		closed	contrib.admin	1.2		duplicate			Unreviewed	0	0	0	0	0	0
