Commit 274d1191 authored by okhin's avatar okhin

Fixing some import for admin to works with translations

parent 508eab39
Pipeline #773 passed with stages
in 52 seconds
......@@ -4,6 +4,7 @@ from modeltranslation.admin import TranslationAdmin, TranslationTabularInline
from picampaign.campaign.models import Campaign, CampaignContact, Argumentary
from picampaign.organization.models import Organization
from picampaign.importer.models import Importer
from picampaign.campaign.translation import CampaignTranslationOptions, ArgumentaryTranslationOptions
class InlineContact(admin.TabularInline):
from modeltranslation.translator import register, TranslationOptions
from modeltranslation.translator import translator, TranslationOptions
from picampaign.campaign.models import Campaign, Argumentary
class CampaignTranslationOptions(TranslationOptions):
fields = ('title', 'description')
class ArgumentaryTranslationOptions(TranslationOptions):
fields = ('title', 'text')
translator.register(Campaign, CampaignTranslationOptions)
translator.register(Argumentary, ArgumentaryTranslationOptions)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment