I have a django 1.8 instance (and python 2) and I am using django-parler for translation. I want to customize the admin interface (I want to use django-autocomplete-light, but that's not relevant). But customizing the admin interface with parler seems a bit more tricky then I thought. Here is a reduced example.
models.py
from django.db import models
from parler.models import TranslatableModel, TranslatedFields
class Fruits(TranslatableModel):
translations = TranslatedFields(
fname=models.CharField(max_length=200)
)
def __unicode__(self):
return self.fname
forms.py
from dal import autocomplete
from django import forms
from .models import Fruits
class FruitsForm(forms.ModelForm):
class Meta:
model = Fruits
fields = (
'fruits',
)
admin.py
from django.contrib import admin
from parler.admin import TranslatableAdmin
from .forms import FruitsForm
from .models import Fruits
class FruitsAdmin(TranslatableAdmin):
form = FruitsForm
model = Fruits
admin.site.register(Fruits, FruitsAdmin)
The Problem
django.core.exceptions.FieldError: Unknown field(s) (fruits) specified for Fruits
What can I do?