Author: Jacob Magnusson. Follow me on Twitter
bootstrap-modeltranslation is a mini-package for adding tabbable django-modeltranslation translation fields to django-admin-bootstrapped.
- Python 2.7.5
- Django 1.6
- django-admin-bootstrapped 0.4.3
- django-modeltranslation 0.7
Install using pip
:
pip install bootstrap-modeltranslation
Add package to INSTALLED_APPS
(order doesn't matter):
INSTALLED_APPS = (
'django_admin_bootstrapped',
'modeltranslation',
...
'bootstrap_modeltranslation',
)
NOTE: bootstrap_modeltranslation
must come before modeltranslation
for tabbed translation fields to work
Copy the static files to your project:
python manage.py collectstatic
Import admin classes for inheritance and use just like you would the default ones (read the modeltranslation docs for more info).
from bootstrap_modeltranslation.admin import (
TranslationAdmin,
TranslationTabularInline,
TranslationStackedInline,
TranslationGenericTabularInline,
TranslationGenericStackedInline)
class SomeModelAdmin(TranslationAdmin):
pass
class SomeModelInlineAdmin(TranslationStackedInline):
pass
This document