﻿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
286	[patch] Eliminate unintuitive behavior when using edit_inline with no core fields specified	rmunn@…	Adrian Holovaty	"Using Django revision 426, Apache+FCGI, MySQL 4.1.11.

I created the basic {{{polls}}} and {{{choices}}} models as per the second tutorial:
{{{
class Poll(meta.Model):
    fields = (
        meta.CharField('question', maxlength=200),
        meta.DateTimeField('pub_date', 'date published'),
    )
    admin = meta.Admin(
        fields = (
            (None, {'fields': ('question',)}),
            ('Date information', {'fields': ('pub_date',), 'classes': 'collapse'}),
        )
    )
    def __repr__(self):
        return self.question

class Choice(meta.Model):
    fields = (
        meta.ForeignKey(Poll, edit_inline=True, num_in_admin=3, num_extra_on_change=3),
        meta.CharField('choice', maxlength=200),
        meta.IntegerField('votes'),
    )
    def __repr__(self):
        return self.choice
}}}
I created a poll in admin interface, with question ""What's up?"" and no choices for the moment:
{{{
>>> from django.models.polls import polls, choices
>>> polls.get_list()
[What's up?]
>>> choices.get_list()
[]
}}}
I added three choices -- ""one"", ""two"", and ""three"" -- in the admin interface, choosing the ""Save and continue editing"" button:
{{{
>>> polls.get_list()
[What's up?]
>>> p = polls.get_object(question__exact=""What's up?"")
>>> p.get_choice_list()
[one, two, three]
}}}
In MySQL:
{{{
mysql> select * from polls_choices ;
+----+---------+--------+-------+
| id | poll_id | choice | votes |
+----+---------+--------+-------+
|  1 |       1 | one    |     0 |
|  2 |       1 | two    |     0 |
|  3 |       1 | three  |     0 |
+----+---------+--------+-------+
3 rows in set (0.00 sec)
}}}
The three choices I just added showed up just fine in the admin interface, along with three blank slots for more choices to be added. I added three more choices -- ""four"", ""five"", and ""six"" -- in the admin interface and clicked ""Save and continue editing"" again. Suddenly the first three choices disappeared, and only the latest three were showing in the admin interface, in the order ""six"", ""five"", and ""four"".

In Python:
{{{
>>> p.get_choice_list()
[six, five, four]
}}}

In MySQL:
{{{
mysql> select * from polls_choices ;
+----+---------+--------+-------+
| id | poll_id | choice | votes |
+----+---------+--------+-------+
|  6 |       1 | six    |     0 |
|  5 |       1 | five   |     0 |
|  4 |       1 | four   |     0 |
+----+---------+--------+-------+
3 rows in set (0.00 sec)
}}}

Adding more choices in the admin interface should ''add'' to, not ''replace'', the already-existing choices."	enhancement	closed	Metasystem		normal	fixed			Unreviewed	1	0	0	0	0	0
