Loading django/contrib/admin/options.py +2 −2 Original line number Diff line number Diff line Loading @@ -638,9 +638,9 @@ class ModelAdmin(BaseModelAdmin): extra = '' if settings.DEBUG else '.min' js = [ 'core.js', 'admin/RelatedObjectLookups.js', 'jquery%s.js' % extra, 'jquery.init.js' 'jquery.init.js', 'admin/RelatedObjectLookups.js', ] if self.actions is not None: js.append('actions%s.js' % extra) Loading django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js +9 −0 Original line number Diff line number Diff line Loading @@ -128,3 +128,12 @@ function dismissDeleteRelatedObjectPopup(win, objId) { // Kept for backward compatibility showAddAnotherPopup = showRelatedObjectPopup; dismissAddAnotherPopup = dismissAddRelatedObjectPopup; django.jQuery(function($){ $(document).ready(function() { $('.related-lookup').click(function(e) { e.preventDefault(); showRelatedObjectLookupPopup(this); }); }); }); django/contrib/admin/templates/admin/change_form.html +0 −4 Original line number Diff line number Diff line Loading @@ -75,10 +75,6 @@ e.preventDefault(); showAddAnotherPopup(this); }); $('.related-lookup').click(function(e) { e.preventDefault(); showRelatedObjectLookupPopup(this); }); {% if adminform and add %} $('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus() {% endif %} Loading docs/releases/1.8.12.txt +3 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,6 @@ Bugfixes * Fixed data loss on SQLite where ``DurationField`` values with fractional seconds could be saved as ``None`` (:ticket:`26324`). * Restored the functionality of the admin's ``raw_id_fields`` in ``list_editable`` (:ticket:`26387`). tests/admin_views/admin.py +19 −10 Original line number Diff line number Diff line Loading @@ -33,16 +33,17 @@ from .models import ( GenRelReference, Grommet, ImplicitlyGeneratedPK, Ingredient, InlineReference, InlineReferer, Inquisition, Language, Link, MainPrepopulated, ModelWithStringPrimaryKey, NotReferenced, OldSubscriber, OtherStory, Paper, Parent, ParentWithDependentChildren, Person, Persona, Picture, Pizza, Plot, PlotDetails, PlotProxy, PluggableSearchPerson, Podcast, Post, PrePopulatedPost, PrePopulatedPostLargeSlug, PrePopulatedSubPost, Promo, Question, Recipe, Recommendation, Recommender, ReferencedByGenRel, ReferencedByInline, ReferencedByParent, RelatedPrepopulated, Report, Reservation, Restaurant, RowLevelChangePermissionModel, Section, ShortMessage, Simple, Sketch, State, Story, StumpJoke, Subscriber, SuperVillain, Telegram, Thing, Topping, UnchangeableObject, UndeletableObject, UnorderedObject, UserMessenger, Villain, Vodcast, Whatsit, Widget, Worker, WorkHour, OtherStory, Paper, Parent, ParentWithDependentChildren, ParentWithUUIDPK, Person, Persona, Picture, Pizza, Plot, PlotDetails, PlotProxy, PluggableSearchPerson, Podcast, Post, PrePopulatedPost, PrePopulatedPostLargeSlug, PrePopulatedSubPost, Promo, Question, Recipe, Recommendation, Recommender, ReferencedByGenRel, ReferencedByInline, ReferencedByParent, RelatedPrepopulated, RelatedWithUUIDPKModel, Report, Reservation, Restaurant, RowLevelChangePermissionModel, Section, ShortMessage, Simple, Sketch, State, Story, StumpJoke, Subscriber, SuperVillain, Telegram, Thing, Topping, UnchangeableObject, UndeletableObject, UnorderedObject, UserMessenger, Villain, Vodcast, Whatsit, Widget, Worker, WorkHour, ) Loading Loading @@ -989,5 +990,13 @@ site.register(Group, GroupAdmin) site2 = admin.AdminSite(name="namespaced_admin") site2.register(User, UserAdmin) site2.register(Group, GroupAdmin) site2.register(ParentWithUUIDPK) site2.register( RelatedWithUUIDPKModel, list_display=['pk', 'parent'], list_editable=['parent'], raw_id_fields=['parent'], ) site7 = admin.AdminSite(name="admin7") site7.register(Article, ArticleAdmin2) Loading
django/contrib/admin/options.py +2 −2 Original line number Diff line number Diff line Loading @@ -638,9 +638,9 @@ class ModelAdmin(BaseModelAdmin): extra = '' if settings.DEBUG else '.min' js = [ 'core.js', 'admin/RelatedObjectLookups.js', 'jquery%s.js' % extra, 'jquery.init.js' 'jquery.init.js', 'admin/RelatedObjectLookups.js', ] if self.actions is not None: js.append('actions%s.js' % extra) Loading
django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js +9 −0 Original line number Diff line number Diff line Loading @@ -128,3 +128,12 @@ function dismissDeleteRelatedObjectPopup(win, objId) { // Kept for backward compatibility showAddAnotherPopup = showRelatedObjectPopup; dismissAddAnotherPopup = dismissAddRelatedObjectPopup; django.jQuery(function($){ $(document).ready(function() { $('.related-lookup').click(function(e) { e.preventDefault(); showRelatedObjectLookupPopup(this); }); }); });
django/contrib/admin/templates/admin/change_form.html +0 −4 Original line number Diff line number Diff line Loading @@ -75,10 +75,6 @@ e.preventDefault(); showAddAnotherPopup(this); }); $('.related-lookup').click(function(e) { e.preventDefault(); showRelatedObjectLookupPopup(this); }); {% if adminform and add %} $('form#{{ opts.model_name }}_form :input:visible:enabled:first').focus() {% endif %} Loading
docs/releases/1.8.12.txt +3 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,6 @@ Bugfixes * Fixed data loss on SQLite where ``DurationField`` values with fractional seconds could be saved as ``None`` (:ticket:`26324`). * Restored the functionality of the admin's ``raw_id_fields`` in ``list_editable`` (:ticket:`26387`).
tests/admin_views/admin.py +19 −10 Original line number Diff line number Diff line Loading @@ -33,16 +33,17 @@ from .models import ( GenRelReference, Grommet, ImplicitlyGeneratedPK, Ingredient, InlineReference, InlineReferer, Inquisition, Language, Link, MainPrepopulated, ModelWithStringPrimaryKey, NotReferenced, OldSubscriber, OtherStory, Paper, Parent, ParentWithDependentChildren, Person, Persona, Picture, Pizza, Plot, PlotDetails, PlotProxy, PluggableSearchPerson, Podcast, Post, PrePopulatedPost, PrePopulatedPostLargeSlug, PrePopulatedSubPost, Promo, Question, Recipe, Recommendation, Recommender, ReferencedByGenRel, ReferencedByInline, ReferencedByParent, RelatedPrepopulated, Report, Reservation, Restaurant, RowLevelChangePermissionModel, Section, ShortMessage, Simple, Sketch, State, Story, StumpJoke, Subscriber, SuperVillain, Telegram, Thing, Topping, UnchangeableObject, UndeletableObject, UnorderedObject, UserMessenger, Villain, Vodcast, Whatsit, Widget, Worker, WorkHour, OtherStory, Paper, Parent, ParentWithDependentChildren, ParentWithUUIDPK, Person, Persona, Picture, Pizza, Plot, PlotDetails, PlotProxy, PluggableSearchPerson, Podcast, Post, PrePopulatedPost, PrePopulatedPostLargeSlug, PrePopulatedSubPost, Promo, Question, Recipe, Recommendation, Recommender, ReferencedByGenRel, ReferencedByInline, ReferencedByParent, RelatedPrepopulated, RelatedWithUUIDPKModel, Report, Reservation, Restaurant, RowLevelChangePermissionModel, Section, ShortMessage, Simple, Sketch, State, Story, StumpJoke, Subscriber, SuperVillain, Telegram, Thing, Topping, UnchangeableObject, UndeletableObject, UnorderedObject, UserMessenger, Villain, Vodcast, Whatsit, Widget, Worker, WorkHour, ) Loading Loading @@ -989,5 +990,13 @@ site.register(Group, GroupAdmin) site2 = admin.AdminSite(name="namespaced_admin") site2.register(User, UserAdmin) site2.register(Group, GroupAdmin) site2.register(ParentWithUUIDPK) site2.register( RelatedWithUUIDPKModel, list_display=['pk', 'parent'], list_editable=['parent'], raw_id_fields=['parent'], ) site7 = admin.AdminSite(name="admin7") site7.register(Article, ArticleAdmin2)