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 10271,Models with multiple inlines inheriting from the same parent class do not save properly in admin,Idan Gazit,Alex Gaynor,"I've attached a model graph and screenshots which illustrate the problem a lot more clearly than my words, but bear with me. I've tried my best to make it unconfusing. :) '''Basically, I can reproducibly make the admin issue incorrect INSERT statements when saving a model with inlines.''' I have a model with inlines of multiple classes (all of which inherit from a common parent). When I create a new instance of the model, it will use only the data from the LAST inline to create all of the model instances for ALL the inlines. For example: I have two models, !TwitterAccount and !DeliciousAccount, both of which inherit from Account. Both are displayed inline in the model admin for the Persona model. When creating a new persona, I enter data for a new !TwitterAccount and a new !DeliciousAccount on the add page for Persona. When I click save, I find that there are ('''correctly''') one new !TwitterAccount and one new !DeliciousAccount, but ('''incorrectly''') both new accounts are populated with the data I entered for the !DeliciousAccount. I've verified that this behavior only occurs for the pages with the inlines: * Model instance creation works as expected from `./manage.py shell` * Model instance creation works as expected if I create the instances one-by-one from a model-specific admin page and not via inlines Attached you'll find three PNGs: 1. '''1_admin.png''': shows the admin add page for the model with the inlines. Note that the data entered for each inline is different. 2. '''2_sql.png''': using the django-debug-toolbar, shows the SQL statements executed after clicking `Save`. Note that `delicious999` is the only data used when creating the inlined model instances. The twitter account is still created — but using the delicious account's data. 3. '''model_graph.png''': shows the models in the application. The various accounts all inherit from Account, the various activities inherit from Activity. I'd love to help in fixing this bug but I could use some guidance on what to do next. Thank you!",,closed,contrib.admin,1.0,,fixed,,,Accepted,1,0,0,0,0,0