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

Could not displayed translated fields when I assign fields in ModelAdmin #38

Open
raccoonyy opened this issue Mar 26, 2018 · 5 comments

Comments

@raccoonyy
Copy link

raccoonyy commented Mar 26, 2018

First of all I appreciate to make this lovely library.

Here is my question.

In default settings, I can see all translated fields.

2018-03-26 15 42 22

But when I assign fields in ModelAdmin like this.

class ProgramAdmin(admin.ModelAdmin):
    model = Program

    fields = ('title', ...)

Then, just one field displayed like below.

2018-03-26 15 43 47

@jieter
Copy link
Member

jieter commented Mar 26, 2018

You don't mention what you expect to see.

The docs have an admin support page, mentioning the ActiveLanguageMixin. It make sure only the default language and the current language are shown. Does that fix your usecase?

@raccoonyy
Copy link
Author

raccoonyy commented Mar 27, 2018

Oh I missed what I expect to see. Sorry.

I want to assign just title into fieldsets options in ModelAdmin.
Then I expect to see translate fields in admin like below.

2018-03-26 15 42 22

Or, would I write all translate fields in fieldsets like this?

fielddsets = (
    ('Basic', {
        'fields': ('title', 'title_en_us', 'title_ko', 'title_zh_hant', 'title_zh_hans')
    }),
)

This is inconvenient way to me. :(

@jieter
Copy link
Member

jieter commented Apr 13, 2018

I see. Interesting use case. But do you want to show all languages to the user always?

@raccoonyy
Copy link
Author

Yes I want.

I explain again because my previouse comments are little confused.


When I have title and somethingfields, I assign fieldsets like below.

fieldsets = (
    ('Basic', {
        'fields': ('title', 'something')
    }),
)

Then, Django admin show me fields only title and something. There isn't title_en_us or title_ko.

I want to see all languages fields about title.

@eriktelepovsky
Copy link

Had same issue. I solved it by removing ActiveLanguageMixin from my Admin class and using title_i18n in fieldsets.

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

3 participants