Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 2.0 support #22

Open
Vadim-Karpenko opened this issue Feb 22, 2018 · 1 comment
Open

Django 2.0 support #22

Vadim-Karpenko opened this issue Feb 22, 2018 · 1 comment

Comments

@Vadim-Karpenko
Copy link

Here is my solution how to make this project support Django 2.0 and newer.
Go to the super_inlines\templatetags\super_inlines.py and replace all from this file by this code:


from __future__ import unicode_literals
from django.template import Library

from ..admin import SuperInlineModelAdmin



register = Library()
register_tag = register.simple_tag

@register_tag(takes_context=True)
def get_sub_inline_formsets(context, inline, original, index, is_template):
    if not isinstance(inline, SuperInlineModelAdmin):
        return ()
    request = context['request']
    formsets, inline_instances = inline._create_formsets(
        request, obj=original, change=original is not None, index=index,
        is_template=is_template)
    return inline.get_inline_formsets(request, formsets, inline_instances,
                                      obj=original)
@WhyNotHugo
Copy link

I've migrated over to django-nested-admin.

It seems to be actively maintained, and supports Django 2.0 just fine. Maybe it's time we gradually move over; there's little need to keep two different apps that do something this simply anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants