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-suit revision template not rendered #438

Closed
ghost opened this issue Oct 10, 2015 · 4 comments
Closed

django-suit revision template not rendered #438

ghost opened this issue Oct 10, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 10, 2015

Just installed django revision and trying to integrate it with my django suit installation but i seem to be running into a snag i.e django-suit revision templates are not been picked up. I tried changing the installed_app order and reversion below django-suit. in this case the django suit templates do get picked up but when i click on the recover deleted object button no redirection to the change_list.html happens no errors. Could be my lack of understanding hope someone can point me to the right direction.

image 1

versions

  • django-suit==0.2.13
  • django-reversion==1.9.3

]

settings.py

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_extensions',
    'reversion', # this order works but revision templates used not django-suit
    'suit',
    'django.contrib.admin',


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(PROJECT_ROOT, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.core.context_processors.request',
                'social.apps.django_app.context_processors.backends',
                'social.apps.django_app.context_processors.login_redirect',
            ],
        },
    },
]

admin.py

from django.contrib import admin
from geography.models import State
from django.forms import TextInput, ModelForm
from reversion.admin import VersionAdmin

class StateForm(ModelForm):
    state_verbose_name = State._meta.verbose_name

    class Meta:
    model = State
        fields = '__all__'
            widgets = {
                'code': TextInput(attrs={'class': 'input-mini'
            }),
        }

class StateAdmin(VersionAdmin):
    form = StateForm
    search_fields = ('code', 'name')
    list_display = ('code', 'name')
    fieldsets = [
        (None, {'fields': ['code', 'name']}),
]
@darklow
Copy link
Owner

darklow commented Oct 11, 2015

Install latest version 0.2.15. This was fixed by PR: #424

pip install -U django-suit

@darklow darklow closed this as completed Oct 11, 2015
@ghost
Copy link
Author

ghost commented Oct 13, 2015

still facing the same issue even after upgrading
tried reversing my installed apps suit first then reversion correct css rendered but when i do click on the recover deleted items get the below exception
'suit',
'reversion',

image 1

Exception

TemplateSyntaxError at /admin/geography/state/recover/
'admin_url' is not a valid tag library: Template library admin_url not found, tried django.templatetags.admin_url,django.contrib.staticfiles.templatetags.admin_url,django_extensions.templatetags.admin_url,suit.templatetags.admin_url,django.contrib.admin.templatetags.admin_url,rest_framework.templatetags.admin_url

@jpic
Copy link
Contributor

jpic commented Dec 13, 2015

Same here, there's a typo in the PR, it's not admin_url, but admin_urls !

Maybe some basic tests ie. with django-test-utils would be nice to have.

@jpic
Copy link
Contributor

jpic commented Dec 13, 2015

PR #455 fixes it.

darklow added a commit that referenced this issue Dec 18, 2015
#438 fixup! Updating breadcrumb URLs for django-reversion 1.9.3 compatibility
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