#14832: Impossible to create inline objects if form validates but is unchanged
----------------------------------+-----------------------------------------
 Reporter:  julien                |       Owner:  nobody    
   Status:  new                   |   Milestone:            
Component:  django.contrib.admin  |     Version:  1.2       
 Keywords:  sprintdec2010         |       Stage:  Unreviewed
Has_patch:  0                     |  
----------------------------------+-----------------------------------------
 Here's a simple test case:

 Models:
 {{{
 #!python

 from django.db import models

 class Account(models.Model):
     name = models.CharField(max_length=100)

 class Expense(models.Model):
     account = models.ForeignKey(Account)
     amount = models. IntegerField(default=100, blank=True, null=True)
     memo = models.CharField(max_length=100, blank=True)
 }}}

 Admin:
 {{{
 #!python

 from django.contrib import admin

 from .models import Account, Expense

 class ExpenseInlineAdmin(admin.TabularInline):
     model = Expense

 class AccountAdmin(admin.ModelAdmin):
     inlines = [ExpenseInlineAdmin]

 admin.site.register(Account, AccountAdmin)
 }}}

 Here there is no way to create an expense object with the amount 100 and
 no memo. This is because Django compares the submitted values with the
 initial ones, and takes a (big) guess that the user wants to create an
 object only because she has *modified* one of the values. If the user is
 happy with the default values and presses 'save', then the expense object
 won't get created.

 I've discussed this at length with DrMeers and russellm during the Dec2010
 sprint. I am conscious that there is no straight forward solution to this,
 and that this approach was designed prior the inclusion of jquery and also
 to allow people without javascript to use inlines. However it seems that
 this system is either flawed by design, or confusing to say the least (as
 people rely on this behaviour and expect things to work the way they
 really shouldn't, i.e. #14095).

 It feels that some user interface design work needs to be done to make
 things more explicit and intuitive. Opening this ticket to keep track of
 this request, as I expect some design discussions need to happen on the
 mailing list in parallel.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14832>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to