Index: django/db/models/fields/related.py
===================================================================
--- django/db/models/fields/related.py	(revision 11118)
+++ django/db/models/fields/related.py	(working copy)
@@ -814,7 +814,9 @@
         Field.__init__(self, **kwargs)
 
         msg = ugettext_lazy('Hold down "Control", or "Command" on a Mac, to select more than one.')
-        self.help_text = string_concat(self.help_text, ' ', msg)
+        # To put help message to edit selected items in many2many and one2many selection field. 
+        change_msg = ugettext_lazy('To edit select only one.')
+        self.help_text = string_concat(self.help_text, ' ', msg, '<br/>', change_msg)
 
     def get_choices_default(self):
         return Field.get_choices(self, include_blank=False)
Index: django/contrib/admin/media/js/admin/RelatedObjectLookups.js
===================================================================
--- django/contrib/admin/media/js/admin/RelatedObjectLookups.js	(revision 11118)
+++ django/contrib/admin/media/js/admin/RelatedObjectLookups.js	(working copy)
@@ -55,7 +55,7 @@
 function showAddAnotherPopup(triggeringLink) {
     var name = triggeringLink.id.replace(/^add_/, '');
     name = id_to_windowname(name);
-    href = triggeringLink.href
+    href = triggeringLink.href;
     if (href.indexOf('?') == -1) {
         href += '?_popup=1';
     } else {
@@ -66,18 +66,57 @@
     return false;
 }
 
-function dismissAddAnotherPopup(win, newId, newRepr) {
+// To show edit popup window of selected item.
+function showChangeCurrentPopup(triggeringLink, element_id) {
+    element = document.getElementById(element_id);
+    var name = triggeringLink.id.replace(/^change_/, '');
+    name = id_to_windowname(name);
+    href = triggeringLink.href;
+   
+    if (href.indexOf('?') == -1) {
+        href += '?_popup=1';
+    } else {
+        href  += '&_popup=1';
+    }
+    var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
+    win.focus();
+    return false;
+}
+
+function dismissAddAnotherPopup(win, newId, newRepr, triggeringLink) {
     // newId and newRepr are expected to have previously been escaped by
     // django.utils.html.escape.
     newId = html_unescape(newId);
     newRepr = html_unescape(newRepr);
     var name = windowname_to_id(win.name);
     var elem = document.getElementById(name);
+   // create a object of changeIcon and ChangeLink.
+    var icon_elem = document.getElementById('change_icon_' + name);
+    var acr_elem = document.getElementById('change_' + name);
     if (elem) {
         if (elem.nodeName == 'SELECT') {
             var o = new Option(newRepr, newId);
             elem.options[elem.options.length] = o;
             o.selected = true;
+            // To hide and visible change_icon image according to number of selection item.
+	    	var count = 0;
+	    	for (i=0; i<elem.options.length; i++) {
+                if (elem.options[i].selected) {
+                        count++;
+                }
+                if (count > 1){
+                        break;
+                }
+            }
+           	if (count == 1){
+                	icon_elem.style.display = '';
+					acr_elem.href = triggeringLink + newId + '/';
+		   	}
+		   	else{
+					icon_elem.style.display = 'none';
+					acr_elem.href = triggeringLink;
+	  		}
+
         } else if (elem.nodeName == 'INPUT') {
             if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) {
                 elem.value += ',' + newId;
@@ -94,3 +133,67 @@
     }
     win.close();
 }
+
+// To close popup edit page.
+function dismissChangeCurrentPopup(win, Id, newRepr) {
+    // Id and newRepr are expected to have previously been escaped by
+    // django.utils.html.escape.
+
+    Id = html_unescape(Id);
+    newRepr = html_unescape(newRepr);
+
+    var name = windowname_to_id(win.name);
+    var elem = document.getElementById(name);
+
+    if (elem) {
+        if (elem.nodeName == 'SELECT') {
+	     for(i=0; i < elem.options.length; i++)
+	     {
+		if(elem.options[i].value == Id)
+		{
+			elem.options[i].text = newRepr;
+			elem.options[i].selected = true;
+		}
+	     }
+
+        } else if (elem.nodeName == 'INPUT') {
+            elem.value = Id;
+        }
+    } else {
+        var toId = name + "_to";
+        elem = document.getElementById(toId);
+        var o = new Option(newRepr, Id);
+        SelectBox.add_to_cache(toId, o);
+        SelectBox.redisplay(toId);
+    }
+    win.close();
+}
+
+// To hide and visible change_icon image according to number of selection item.
+function onChangeValue(element, triggeringLink, anchor_id, icon_id)
+{
+	var i;
+  	var count = 0;
+	var icon_elem = document.getElementById(icon_id);
+	var acr_elem = document.getElementById(anchor_id);
+
+  	for (i=0; i<element.options.length; i++) {
+    		if (element.options[i].selected) {      			
+      			count++;
+    		}
+		if (count > 1){
+			icon_elem.style.display = 'none';
+			acr_elem.href = triggeringLink;
+			return;
+		}
+  	}
+
+	if (!element.value){
+		icon_elem.style.display = 'none';
+		acr_elem.href = triggeringLink;
+	}
+	else{	
+		icon_elem.style.display = '';
+		acr_elem.href = triggeringLink + element.value + '/';
+	}
+}
\ No newline at end of file
Index: django/contrib/admin/options.py
===================================================================
--- django/contrib/admin/options.py	(revision 11118)
+++ django/contrib/admin/options.py	(working copy)
@@ -20,6 +20,7 @@
 from django.utils.translation import ugettext as _
 from django.utils.translation import ungettext, ugettext_lazy
 from django.utils.encoding import force_unicode
+from django.core.urlresolvers import reverse, NoReverseMatch
 try:
     set
 except NameError:
@@ -605,9 +606,17 @@
             return HttpResponseRedirect(post_url_continue % pk_value)
 
         if request.POST.has_key("_popup"):
-            return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \
+            info = (opts.app_label, opts.object_name.lower())
+            # To add URL for Change existing record.
+            try:
+                related_info = (self.admin_site.name,) + info
+                change_url = reverse('%sadmin_%s_%s_' % related_info)
+            except NoReverseMatch:
+                change_url = '../../../%s/%s/' % info
+        
+            return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s", "%s");</script>' % \
                 # escape() calls force_unicode.
-                (escape(pk_value), escape(obj)))
+                (escape(pk_value), escape(obj), change_url))
         elif request.POST.has_key("_addanother"):
             self.message_user(request, msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
             return HttpResponseRedirect(request.path)
@@ -644,6 +653,11 @@
         elif request.POST.has_key("_addanother"):
             self.message_user(request, msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
             return HttpResponseRedirect("../add/")
+        # To close popup edit window.
+        elif request.POST.has_key("_popup"):
+            return HttpResponse('<script type="text/javascript">opener.dismissChangeCurrentPopup(window, "%s", "%s");</script>' % \
+                # escape() calls force_unicode.
+                (escape(pk_value), escape(obj)))
         else:
             self.message_user(request, msg)
             return HttpResponseRedirect("../")
Index: django/contrib/admin/widgets.py
===================================================================
--- django/contrib/admin/widgets.py	(revision 11118)
+++ django/contrib/admin/widgets.py	(working copy)
@@ -3,6 +3,7 @@
 """
 
 import copy
+import types
 
 from django import forms
 from django.forms.widgets import RadioFieldRenderer
@@ -221,19 +222,39 @@
     def render(self, name, value, *args, **kwargs):
         rel_to = self.rel.to
         info = (rel_to._meta.app_label, rel_to._meta.object_name.lower())
+        # To edit URL Pattern for Add new records and for Change existing record.
         try:
             related_info = (self.admin_site.name,) + info
-            related_url = reverse('%sadmin_%s_%s_add' % related_info)
+            add_url = reverse('%sadmin_%s_%s_add' % related_info)
         except NoReverseMatch:
-            related_url = '../../../%s/%s/add/' % info
+            add_url = '../../../%s/%s/add/' % info
+        try:
+            change_url = reverse('%sadmin_%s_%s_' % related_info)
+        except NoReverseMatch:
+            change_url = '../../../%s/%s/' % info
         self.widget.choices = self.choices
+        # To put a onChange event in selection tag.
+        if kwargs.get('attrs', False):
+            kwargs['attrs'].update({"onchange": "onChangeValue(this, '%s', 'change_id_%s', 'change_icon_id_%s')" % (change_url, name, name)})
         output = [self.widget.render(name, value, *args, **kwargs)]
         if rel_to in self.admin_site._registry: # If the related object has an admin interface:
             # TODO: "id_" is hard-coded here. This should instead use the correct
             # API to determine the ID dynamically.
             output.append(u'<a href="%s" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> ' % \
-                (related_url, name))
+                (add_url, name))
             output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="%s"/></a>' % (settings.ADMIN_MEDIA_PREFIX, _('Add Another')))
+            # To put a changeLink, changeLinkIcon in selecion widget and to add id of selected record in ChangeLink.
+            display = None
+            id = ''
+            if value and (type(value) == types.ListType and len(value) == 1) or (type(value) == types.IntType):
+                display = ''
+                if type(value) == types.ListType:
+                    id = '%s/'% (value[0],)
+                else:
+                    id = '%s/'% (value,)
+            output.append(u'''<a href="%s%s" class="change-current" id="change_id_%s" onclick="return showChangeCurrentPopup(this, 'id_%s');"> ''' % \
+            (change_url, id, name, name))
+            output.append(u'<img src="%simg/admin/icon_changelink.gif" width="10" height="10" alt="%s" id="change_icon_id_%s" style="display:%s;"/></a>' % (settings.ADMIN_MEDIA_PREFIX, _('Edit'), name, display))
         return mark_safe(u''.join(output))
 
     def build_attrs(self, extra_attrs=None, **kwargs):
