# (c) cavaliba.com - data - field - string

from .field import Field




# -------------
# STRING
# -------------

# dataformat_ext:
# - safe : display unescaped
# - url  : display as <a> link in detail

class FieldString(Field):

    # def __init__(self, fieldname, fieldschema, alljson):
    #     super().__init__(fieldname, fieldschema, alljson)

    #     # if no json, unpack default_value
    #     if not alljson:
    #         if self.default_value:
    #             self.value = self.default_value


    def merge_import(self, data):
        # no split composite !
        self.value = []
        if type(data) is str:
            self.value = [data]
        elif type(data) is list:
            for i in data:
                self.value.append(i)

    def is_valid(self):
        r = super().is_valid()
        # TODO
        return r

