diff -r 3e100985dbfa django/contrib/admin/media/js/SelectFilter2.js
--- a/django/contrib/admin/media/js/SelectFilter2.js	Sun Feb 14 20:17:07 2010 -0600
+++ b/django/contrib/admin/media/js/SelectFilter2.js	Tue Feb 16 16:17:36 2010 -0600
@@ -16,6 +16,10 @@
 
 var SelectFilter = {
     init: function(field_id, field_name, is_stacked, admin_media_prefix) {
+        if (field_id.match(/__prefix__/)){
+            // Don't intialize on empty forms.
+            return;
+        }
         var from_box = document.getElementById(field_id);
         from_box.id += '_from'; // change its ID
         from_box.className = 'filtered';
diff -r 3e100985dbfa django/contrib/admin/media/js/admin/DateTimeShortcuts.js
--- a/django/contrib/admin/media/js/admin/DateTimeShortcuts.js	Sun Feb 14 20:17:07 2010 -0600
+++ b/django/contrib/admin/media/js/admin/DateTimeShortcuts.js	Tue Feb 16 16:17:36 2010 -0600
@@ -11,6 +11,7 @@
     calendarLinkName: 'calendarlink',// name of the link that is used to toggle
     clockDivName: 'clockbox',        // name of clock <div> that gets toggled
     clockLinkName: 'clocklink',      // name of the link that is used to toggle
+    shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts
     admin_media_prefix: '',
     init: function() {
         // Deduce admin_media_prefix by looking at the <script>s in the
@@ -42,6 +43,7 @@
 
         // Shortcut links (clock icon and "Now" link)
         var shortcuts_span = document.createElement('span');
+        shortcuts_span.className = DateTimeShortcuts.shortCutsClass;
         inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
         var now_link = document.createElement('a');
         now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + get_format('TIME_INPUT_FORMATS')[0] + "'));");
@@ -128,6 +130,7 @@
 
         // Shortcut links (calendar icon and "Today" link)
         var shortcuts_span = document.createElement('span');
+        shortcuts_span.className = DateTimeShortcuts.shortCutsClass;
         inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
         var today_link = document.createElement('a');
         today_link.setAttribute('href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);');
diff -r 3e100985dbfa django/contrib/admin/media/js/inlines.js
--- a/django/contrib/admin/media/js/inlines.js	Sun Feb 14 20:17:07 2010 -0600
+++ b/django/contrib/admin/media/js/inlines.js	Tue Feb 16 16:17:36 2010 -0600
@@ -34,7 +34,6 @@
 		var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").attr("autocomplete", "off");
 		// only show the add button if we are allowed to add more items
 		var showAddButton = ((maxForms.val() == 0) || ((maxForms.val()-totalForms.val()) > 0));
-		var selectedItems = this;
 		$(this).each(function(i) {
 			$(this).not("." + options.emptyCssClass).addClass(options.formCssClass);
 		});
diff -r 3e100985dbfa django/contrib/admin/templates/admin/edit_inline/stacked.html
--- a/django/contrib/admin/templates/admin/edit_inline/stacked.html	Sun Feb 14 20:17:07 2010 -0600
+++ b/django/contrib/admin/templates/admin/edit_inline/stacked.html	Tue Feb 16 16:17:36 2010 -0600
@@ -1,4 +1,4 @@
-{% load i18n %}
+{% load i18n adminmedia %}
 <div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
   <h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2>
 {{ inline_admin_formset.formset.management_form }}
@@ -22,12 +22,32 @@
 (function($) {
     $(document).ready(function() {
         var rows = "#{{ inline_admin_formset.formset.prefix }}-group .inline-related";
-        updateInlineLabel = function(row) {
+        var updateInlineLabel = function(row) {
             $(rows).find(".inline_label").each(function(i) {
                 var count = i + 1;
                 $(this).html($(this).html().replace(/(#\d+)/g, "#" + count));
             });
         }
+        var reinitDateTimeShortCuts = function() {
+            // Reinitialize the calendar and clock widgets by force, yuck.
+            if (typeof DateTimeShortcuts != "undefined") {
+                $(".datetimeshortcuts").remove();
+                DateTimeShortcuts.init();
+            }
+        }
+        var updateSelectFilter = function() {
+            // If any SelectFilter widgets were added, instantiate a new instance.
+            if (typeof SelectFilter != "undefined"){
+                $(".selectfilter").each(function(index, value){
+                  var namearr = value.name.split('-');
+                  SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}");
+                })
+                $(".selectfilterstacked").each(function(index, value){
+                  var namearr = value.name.split('-');
+                  SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}");
+                })
+            }
+        }
         $(rows).formset({
             prefix: "{{ inline_admin_formset.formset.prefix }}",
             addText: "{% blocktrans with inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}",
@@ -36,8 +56,12 @@
             deleteText: "{% trans "Remove" %}",
             emptyCssClass: "empty-form",
             removed: updateInlineLabel,
-            added: updateInlineLabel
+            added: (function(row) {
+                reinitDateTimeShortCuts();
+                updateSelectFilter();
+                updateInlineLabel(row);
+            })
         });
     });
 })(jQuery.noConflict());
-</script>
\ No newline at end of file
+</script>
diff -r 3e100985dbfa django/contrib/admin/templates/admin/edit_inline/tabular.html
--- a/django/contrib/admin/templates/admin/edit_inline/tabular.html	Sun Feb 14 20:17:07 2010 -0600
+++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html	Tue Feb 16 16:17:36 2010 -0600
@@ -1,4 +1,4 @@
-{% load i18n %}
+{% load i18n adminmedia %}
 <div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
   <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
 {{ inline_admin_formset.formset.management_form }}
@@ -68,11 +68,32 @@
 (function($) {
     $(document).ready(function($) {
         var rows = "#{{ inline_admin_formset.formset.prefix }}-group .tabular.inline-related tbody tr";
-        alternatingRows = function(row) {
+        var alternatingRows = function(row) {
             $(rows).not(".add-row").removeClass("row1 row2")
                 .filter(":even").addClass("row1").end()
                 .filter(rows + ":odd").addClass("row2");
         }
+        var reinitDateTimeShortCuts = function() {
+            // Reinitialize the calendar and clock widgets by force
+            if (typeof DateTimeShortcuts != "undefined") {
+                $(".datetimeshortcuts").remove();
+                DateTimeShortcuts.init();
+            }
+        }
+        var updateSelectFilter = function() {
+            // If any SelectFilter widgets are a part of the new form,
+            // instantiate a new SelectFilter instance for it.
+            if (typeof SelectFilter != "undefined"){
+                $(".selectfilter").each(function(index, value){
+                  var namearr = value.name.split('-');
+                  SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}");
+                })
+                $(".selectfilterstacked").each(function(index, value){
+                  var namearr = value.name.split('-');
+                  SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}");
+                })
+            }
+        }
         $(rows).formset({
             prefix: "{{ inline_admin_formset.formset.prefix }}",
             addText: "{% blocktrans with inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}",
@@ -81,8 +102,12 @@
             deleteText: "{% trans "Remove" %}",
             emptyCssClass: "empty-form",
             removed: alternatingRows,
-            added: alternatingRows
+            added: (function(row) {
+                reinitDateTimeShortCuts();
+                updateSelectFilter();
+                alternatingRows(row);
+            })
         });
     });
 })(jQuery.noConflict());
-</script>
\ No newline at end of file
+</script>
diff -r 3e100985dbfa django/contrib/admin/widgets.py
--- a/django/contrib/admin/widgets.py	Sun Feb 14 20:17:07 2010 -0600
+++ b/django/contrib/admin/widgets.py	Tue Feb 16 16:17:36 2010 -0600
@@ -33,6 +33,9 @@
         super(FilteredSelectMultiple, self).__init__(attrs, choices)
 
     def render(self, name, value, attrs=None, choices=()):
+        if attrs is None: attrs = {}
+        attrs['class'] = 'selectfilter'
+        if self.is_stacked: attrs['class'] += 'stacked'
         output = [super(FilteredSelectMultiple, self).render(name, value, attrs, choices)]
         output.append(u'<script type="text/javascript">addEvent(window, "load", function(e) {')
         # TODO: "id_" is hard-coded here. This should instead use the correct
