--- django/db/models/base.py	2006-06-27 15:08:19.000000000 -0300
+++ django/db/models/base.py	2006-06-27 15:35:35.000000000 -0300
@@ -150,6 +150,45 @@
 
         if hasattr(cls, 'get_absolute_url'):
             cls.get_absolute_url = curry(get_absolute_url, opts, cls.get_absolute_url)
+        
+        # Retrieves the list of fields with related objects
+        # (Foreign keys)
+        fk_fields = [x for x in cls._meta.fields if x.rel]
+        thiscls_fqn = "%s.%s" % (cls.__module__,cls.__name__)
+        for field in fk_fields:
+            # Retrieve model that is related to the field
+            rel_model = field.rel.to
+            # Check if the related model as a inline_models field
+            if not hasattr(rel_model,'_meta'):
+                continue
+            if rel_model._meta.admin:
+                for inline_info in rel_model._meta.admin.inline_models:
+                    model_fqn = inline_info['model']
+                    if not '.' in model_fqn:
+                        model_fqn = "%s.%s" % (cls.__module__,model_fqn)
+                    # There this model is defined in the related model's
+                    # inline_models entry
+                    if model_fqn == thiscls_fqn:
+                        # Set edit_inline and other attributes in the model
+                        # According to the inline_models entry
+                        rel_fieldname = inline_info.get('related_field',None)
+                        # The field name can be set with the 'related_field'
+                        # argument
+                        if rel_fieldname:
+                            rel_field = cls._meta.get_field(rel_fieldname) 
+                        else:
+                            fields = [x for x in cls._meta.fields if x.rel]
+                            rel_field = [x for x in fields if  x.rel.to==rel_model][0]
+                        for key,val in inline_info.iteritems():
+                            if key=='type':
+                                rel_field.rel.edit_inline = val
+                            elif key=='core_fields':
+                                for field_name in val:
+                                    cls._meta.get_field(field_name).core = True
+                            elif hasattr(rel_field.rel,key):
+                                setattr(rel_field.rel,key,val)
+                        
 
         dispatcher.send(signal=signals.class_prepared, sender=cls)
diff -ur --exclude-from=exc django_src/django/db/models/options.py django_src_new/django/db/models/options.py
--- django/db/models/options.py	2006-06-27 13:31:39.000000000 -0300
+++ django/db/models/options.py	2006-06-27 10:25:18.000000000 -0300
@@ -201,7 +201,8 @@
 class AdminOptions(object):
     def __init__(self, fields=None, js=None, list_display=None, list_filter=None,
         date_hierarchy=None, save_as=False, ordering=None, search_fields=None,
-        save_on_top=False, list_select_related=False, manager=None, list_per_page=100):
+        save_on_top=False, list_select_related=False, manager=None, list_per_page=100,
+        inline_models=[]):
         self.fields = fields
         self.js = js or []
         self.list_display = list_display or ['__str__']
@@ -212,6 +213,7 @@
         self.save_on_top = save_on_top
         self.list_select_related = list_select_related
         self.list_per_page = list_per_page
+        self.inline_models = inline_models
         self.manager = manager or Manager()
 
     def get_field_sets(self, opts):
diff -ru --exclude-from=exc django_src_new/docs/model-api.txt django_src/docs/model-api.txt
--- django/docs/model-api.txt	2006-06-27 10:16:10.000000000 -0300
+++ django/docs/model-api.txt	2006-06-27 14:00:53.000000000 -0300
@@ -1176,6 +1176,34 @@
 under the heading of the fieldset. It's used verbatim, so you can use any HTML
 and you must escape any special HTML characters (such as ampersands) yourself.
 
+``inline_models``
+-----------------
+A list of dicts that define which related models should be edited inline with
+the given model. It's a cleaner alternative to edit_inline, with the
+following differences:
+  - You define the model with the 'model' keyword argument. You have to use
+    the model as a ``string``, not the ``class``.
+  - You can use the 'related_field' keyword to define the related model's
+    ForeignKey that will be used, or leave Django to catch the first
+    ForeignKey field to the parent model.
+  - Instead of the 'edit_inline' keyword, you use the 'type' keyword.
+  - Instead of specifying core=True in each field you want to show in
+    the inline admin, you use the 'core_fields' keyword argument, which is
+    a list of fields
+All other options can be used, e.g. ``min_num_in_admin``.
+
+Example::
+    inline_models = (
+        {'model':'InlineModel',
+         'type':models.TABULAR,
+         'min_num_in_admin':1,
+         'num_extra_on_change':1,
+         'core_fields':('field1','field2','field3')
+        },
+    )
+
+Check the ``edit_inline`` section for more arguments on this option.
+
 ``js``
 ------
 
