spanishdict/django-nested-inlines — pull request #4 by sandinmyjoints (2014-10-06 15:29:44+00:00)
Title: Remove unwanted fks.

@CarsonBanov

Instead of changing a regex, it seems we can just walk up the dom looking at whether the "parent" model has its own primary key. If not, then the "child" model should not have a foreign key, so remove it if it exists (which it would if the existing child model's dom that was cloned to create the new child model had a fk to point to its own parent model).

So the previous case of adding a new sense below the blank sense, filling it in and filling in a translation within it, and saving, should still be fixed. In addition, if you do that and also fill in the example, it should work. And, if you click "add a new translation" within an existing sense, and fill in the example in the new translation, it should work. Both of those cases in master will give you an error.

/cc @nanek
[#79026140]