ojii / django-multilingual-ng

THIS PROJECT IS *NOT* SUPPORTED AND SHOULD NOT BE USED UNLESS YOU KNOW EXACTLY WHAT YOU'RE DOING!!!

Home Page:https://github.com/KristianOellegaard/django-hvad

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

refers to field 'XXX' that is missing from the form

vasylnakvasiuk opened this issue · comments

models.py:

from multilingual.translation import TranslationModel
from django.db import models

class Currency(models.Model):
class Translation(TranslationModel):
title = models.CharField((Title'), max_length=25)
exchange = models.FloatField(
('Exchange'))

admin.py:

from multilingual.admin import MultilingualModelAdmin

class CurrencyAdmin(MultilingualModelAdmin):
list_display = ('title', 'exchange')
fieldsets = [
(_('Основное'), {'fields': ['title', 'exchange']}),
]
admin.site.register(models.Currency, CurrencyAdmin)

ERROR:
'CurrencyAdmin.fieldsets[0][1]['fields']' refers to field 'title' that is missing from the form.

You have to use use_fieldsets instead of fieldsets. This is due to django's validation of fieldsets.

ok. it's work... and after that I have 2 question:

  1. why while I use in admin.py
    class CurrencyAdmin(django.contrib.admin.ModelAdmin)
    instead of
    class CurrencyAdmin(multilingual.admin.MultilingualModelAdmin)
    it works normally?

  2. Can you add some tutorial about starting using your project? Thanks...

And thanks again for your great job!!! ))

oops... I use use_fieldsets and multilingual.admin.MultilingualModelAdmin in admin.py and admin don't want to save value in that field, wich must be translated.