This is the situation:
models.py:
class Question(models.Model):
text = models.charField(max_length=200)
class Choice(models.Model):
question = models.foreignKey(Question)
option = models.charField(max_length=75)
admin.py
class ChoiceAdminInline(admin.stackedInline):
model = Choice
class QuestionAdmin(admin.ModelAdmin):
inlines = [ChoiceAdminInline]
In the admin, choices are displayed in an inline list below the question. Adding a new choice works fine, but deleting a choice removes the choice and also the question, which is unexpected. Deleting the choice in the Django shell only deletes the choice. Am I missing something about the behavior of inline admin elements?
I'm using Grappelli and Django 1.7. Upgrading Django isn't an option at the moment.