src/polemictweet/translation.py
author ymh <ymh.work@gmail.com>
Tue, 26 Mar 2013 11:18:27 +0100
changeset 12 c105a6d6bcbf
parent 1 5a91860c5535
permissions -rw-r--r--
Merge with f3ba7e0bed68afc4e4b2c9c4e4dc74e5ac2652a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     1
from modeltranslation.translator import translator, TranslationOptions
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     2
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     3
from polemictweet.models import Event, Content, Group
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     4
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     5
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     6
class EventTranslationOptions(TranslationOptions):
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     7
    fields = ('title', 'description', 'program', 'event_image')
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     8
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
     9
class ContentTranslationOptions(TranslationOptions):
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    10
    fields = ('display', 'program')
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    11
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    12
class GroupTranslationOptions(TranslationOptions):
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    13
    fields = ('title', 'description')
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    14
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    15
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    16
translator.register(Event, EventTranslationOptions)
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    17
translator.register(Content, ContentTranslationOptions)
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    18
translator.register(Group, GroupTranslationOptions)
5a91860c5535 first commit of polemictweet
grandjoncl
parents:
diff changeset
    19