Skip to content

Commit

Permalink
Merge pull request Soaa-#21 from lightbulbjim/master
Browse files Browse the repository at this point in the history
Replace deprecated calls.
  • Loading branch information
s-block committed May 17, 2015
2 parents d4a4137 + 8c1b9e9 commit 08b77a2
Show file tree
Hide file tree
Showing 2 changed files with 7 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load i18n admin_static admin_modify %}
{% load cycle from future %}
<div class="inline-group{% if recursive_formset %} {{ recursive_formset.formset.prefix|default:"Root" }}-nested-inline{% if prev_prefix %} {{ prev_prefix }}-{{ loopCounter }}-nested-inline{% endif %} nested-inline{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-group">
{% with recursive_formset=inline_admin_formset stacked_template='admin/edit_inline/stacked-nested.html' tabular_template='admin/edit_inline/tabular-nested.html'%}
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}" id="{{ recursive_formset.formset.prefix }}">
Expand Down

0 comments on commit 08b77a2

Please sign in to comment.