""" Resource used for import/export resources data.
A documentation about Resource is available in import_export.resources module.
"""

from mtp.apps.import_export import resources

from .models import Choice, Pool, Question


class PoolResource(resources.Resource):
    """ Resource for Pool. """

    fields_to_translate = ('name', 'description')


class QuestionResource(resources.Resource):
    """ Resource for Question. """

    fields_to_translate = ('name',)
    fk_fields_to_translate = ('pool',)


class ChoiceResource(resources.Resource):
    """ Resource for Choice. """

    fields_to_translate = ('label', 'detail')
    fk_fields_to_translate = ('question',)


resources.register(Pool, PoolResource)
resources.register(Question, QuestionResource)
resources.register(Choice, ChoiceResource)
