예제 #1
0
    def to_entity(self, data: User) -> str:
        datas = str(data)
        query = ''

        for i in datas.split(','):
            temp = data.to_dict().get(i.strip())
            if (temp):
                type_data = data.define_type(i.strip())
                query += '{} = {},'.format(
                    i.strip(), self.conversor.to_entity(type_data, temp))

        query = query[:-1]
        return query
예제 #2
0
    def to_entity(self, data: User) -> (str, str):
        datas = str(data)
        query = definitions = ''

        for i in datas.split(','):
            temp = data.to_dict().get(i.strip())
            if (temp):
                type_data = data.define_type(i.strip())
                query += self.conversor.to_entity(type_data, temp)
                definitions += i.strip()
                query += ','
                definitions += ','

        query = query[:-1]
        definitions = definitions[:-1]
        return (query, definitions)