

from Ft.Ods import Database, Date
from Ft.Ods.StorageManager.Adapters import Constants

import types

class CollectionOfLiterals:

    #4ODS interfaces
    def _4ods_prepareValue(self,value):
        return self._tx._4ods_createLiteralInstance(self._subType,self._subTypeRepoId,value)

    def _4ods_unprepareValue(self,value):
        #Do a type check
        Constants.g_typeCheck[self._subType](value,self._subTypeRepoId)
        rt = value._4ods_getData()
        if self._subType == Constants.Types.ENUMERATION:
            return rt[0]
        return rt

    def _4ods_prepareChange(self,change):
        return change
