mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-15 16:33:08 +00:00
cleanup: remove old workarounds
This commit is contained in:
parent
56707df455
commit
0dbac334b6
1 changed files with 3 additions and 33 deletions
|
|
@ -1,7 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from copy import deepcopy
|
||||
|
||||
import django
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.options import BaseModelAdmin, flatten_fieldsets, InlineModelAdmin
|
||||
from django import forms
|
||||
|
|
@ -13,16 +12,8 @@ from modeltranslation.utils import (
|
|||
get_language_bidi, unique)
|
||||
from modeltranslation.widgets import ClearableWidgetWrapper
|
||||
|
||||
# Ensure that models are registered for translation before TranslationAdmin
|
||||
# runs. The import is supposed to resolve a race condition between model import
|
||||
# and translation registration in production (see issue #19).
|
||||
if django.VERSION < (1, 7):
|
||||
from django.contrib.contenttypes.generic import GenericTabularInline
|
||||
from django.contrib.contenttypes.generic import GenericStackedInline
|
||||
import modeltranslation.models # NOQA
|
||||
else:
|
||||
from django.contrib.contenttypes.admin import GenericTabularInline
|
||||
from django.contrib.contenttypes.admin import GenericStackedInline
|
||||
from django.contrib.contenttypes.admin import GenericTabularInline
|
||||
from django.contrib.contenttypes.admin import GenericStackedInline
|
||||
|
||||
|
||||
class TranslationBaseModelAdmin(BaseModelAdmin):
|
||||
|
|
@ -360,24 +351,6 @@ class TranslationGenericStackedInline(TranslationInlineModelAdmin, GenericStacke
|
|||
pass
|
||||
|
||||
|
||||
class TabbedDjango15JqueryTranslationAdmin(TranslationAdmin):
|
||||
"""
|
||||
Convenience class which includes the necessary static files for tabbed
|
||||
translation fields. Reuses Django's internal jquery version. Django 1.5
|
||||
included jquery 1.4.2 which is known to work well with jquery-ui 1.8.2.
|
||||
"""
|
||||
class Media:
|
||||
js = (
|
||||
'modeltranslation/js/force_jquery.js',
|
||||
'//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js',
|
||||
'//cdn.jsdelivr.net/jquery.mb.browser/0.1/jquery.mb.browser.min.js',
|
||||
'modeltranslation/js/tabbed_translation_fields.js',
|
||||
)
|
||||
css = {
|
||||
'all': ('modeltranslation/css/tabbed_translation_fields.css',),
|
||||
}
|
||||
|
||||
|
||||
class TabbedDjangoJqueryTranslationAdmin(TranslationAdmin):
|
||||
"""
|
||||
Convenience class which includes the necessary media files for tabbed
|
||||
|
|
@ -412,7 +385,4 @@ class TabbedExternalJqueryTranslationAdmin(TranslationAdmin):
|
|||
}
|
||||
|
||||
|
||||
if django.VERSION < (1, 6):
|
||||
TabbedTranslationAdmin = TabbedDjango15JqueryTranslationAdmin
|
||||
else:
|
||||
TabbedTranslationAdmin = TabbedDjangoJqueryTranslationAdmin
|
||||
TabbedTranslationAdmin = TabbedDjangoJqueryTranslationAdmin
|
||||
|
|
|
|||
Loading…
Reference in a new issue