﻿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
2248	[patch] inline_models, replacement for edit_inline and core=True	joaoma@…	nobody	"I always found the edit_inline syntax quite strange. So, I decided to try something different: let the inline models be configured in the model itself, not in the children models. I came up with the given patch, which basically allows the use of inline models the following way:
{{{
class Person(models.Model):
    name = models.CharField(maxlength=20)
    
    class Admin:
        inline_models = (
            {'model':'Child',
             'type':models.TABULAR,
             'min_num_in_admin':3,
             'max_num_in_admin':20,
             'num_extra_on_change':3,
             'fields':('name','age',) 
            },
            {'model':'Job',
             'type':models.STACKED,
             'min_num_in_admin':1,
             'max_num_in_admin':3,
             'fields':('company','salary',) 
            }
        )

class Child(models.Model):
    parent = models.ForeignKey(Person)
    name = models.CharField(maxlength=100)
    age = models.IntegerField()
    hair_color = models.CharField(maxlength=20,blank=True,null=True)

class Job(models.Model):
    person = models.ForeignKey(Person)
    company = models.CharField(maxlength=100)
    salary = models.IntegerField()
    section = models.CharField(maxlength=50)
}}}
"	enhancement	closed	contrib.admin	dev	minor	wontfix	edit_inline	tyson@… jkocherhans@… gary.wilson@… karsten@… ruckc@…	Design decision needed	1	0	1	0	0	0
