#617 closed defect (invalid)
num_in_admin problem in tutorial
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It seems that when I changed the poll admin page to include the choices with num_in_admin=3, it didn't display 3 for existing polls.
Existing polls only show 1 new row more than the number of choices I already had. In other words, if my poll has no choices, it shows 1 blank row. If I had one choice, it shows one blank row after that (2 total), if I had 2 choices, it shows 1 blank row (3 total)... after that it's moot because num_in_admin=3 is fulfilled.
Here's an image showing my code vs what I got,
http://img402.imageshack.us/img402/9155/adminq21sg.png
It should be noted that if I went to "Add New Poll", it would have 3 new empty choice slots, it just doesn't seem to work for existing polls...?
(I'm not sure if this would be 1.1 or what but I'm using svn-r844)
Change History (2)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Yes, this is expected behavior. By default, when you go to a change page, Django gives you one empty extra row for edit_inline
objects. Use num_extra_on_change
to change this from 1 (the default) to whatever number you want. See http://www.djangoproject.com/documentation/model_api/#admin-options for the full scoop.
This is, currently, expected behaviour AFAIK.
The current plan (AFAIK) is to make this all use explicit add/delete behaviour soon after the new-admin branch lands ( and get rid of the concept of core fields, etc). Num_in_admin would go at the same time.
So maybe this is a duplicate of #13.