Skip to content

Commit

Permalink
Replaced ModelAdmin.queryset() with ModelAdmin.get_queryset().
Browse files Browse the repository at this point in the history
  • Loading branch information
lightbulbjim committed Nov 28, 2014
1 parent 5a6d10d commit 2648f85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nested_inline/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ def add_nested_inline_formsets(self, request, inline, formset, depth=0):
if request.method == 'POST' and any(s.startswith(prefix) for s in request.POST.keys()):
nested_formset = InlineFormSet(request.POST, request.FILES,
instance=form.instance,
prefix=prefix, queryset=nested_inline.queryset(request))
prefix=prefix, queryset=nested_inline.get_queryset(request))
else:
nested_formset = InlineFormSet(instance=form.instance,
prefix=prefix, queryset=nested_inline.queryset(request))
prefix=prefix, queryset=nested_inline.get_queryset(request))
nested_formsets.append(nested_formset)
if nested_inline.inlines:
self.add_nested_inline_formsets(request, nested_inline, nested_formset, depth=depth+1)
Expand Down Expand Up @@ -173,7 +173,7 @@ def add_view(self, request, form_url='', extra_context=None):
formset = FormSet(data=request.POST, files=request.FILES,
instance=new_object,
save_as_new="_saveasnew" in request.POST,
prefix=prefix, queryset=inline.queryset(request))
prefix=prefix, queryset=inline.get_queryset(request))
formsets.append(formset)
if inline.inlines:
self.add_nested_inline_formsets(request, inline, formset)
Expand Down Expand Up @@ -201,7 +201,7 @@ def add_view(self, request, form_url='', extra_context=None):
if prefixes[prefix] != 1 or not prefix:
prefix = "%s-%s" % (prefix, prefixes[prefix])
formset = FormSet(instance=self.model(), prefix=prefix,
queryset=inline.queryset(request))
queryset=inline.get_queryset(request))
formsets.append(formset)
if hasattr(inline, 'inlines') and inline.inlines:
self.add_nested_inline_formsets(request, inline, formset)
Expand Down Expand Up @@ -276,7 +276,7 @@ def change_view(self, request, object_id, form_url='', extra_context=None):
prefix = "%s-%s" % (prefix, prefixes[prefix])
formset = FormSet(request.POST, request.FILES,
instance=new_object, prefix=prefix,
queryset=inline.queryset(request))
queryset=inline.get_queryset(request))
formsets.append(formset)
if hasattr(inline, 'inlines') and inline.inlines:
self.add_nested_inline_formsets(request, inline, formset)
Expand All @@ -297,7 +297,7 @@ def change_view(self, request, object_id, form_url='', extra_context=None):
if prefixes[prefix] != 1 or not prefix:
prefix = "%s-%s" % (prefix, prefixes[prefix])
formset = FormSet(instance=obj, prefix=prefix,
queryset=inline.queryset(request))
queryset=inline.get_queryset(request))
formsets.append(formset)
if hasattr(inline, 'inlines') and inline.inlines:
self.add_nested_inline_formsets(request, inline, formset)
Expand Down

0 comments on commit 2648f85

Please sign in to comment.