def update_or_create(cls, view_integracao, obj):

        map_fields = view_integracao.map_fields
        ta_values = getattr(view_integracao, 'ta_values', {})

        related_object_type = ContentType.objects.get_for_model(obj)
        ta = TextoArticulado.objects.filter(
            object_id=obj.pk,
            content_type=related_object_type)

        ta_exists = bool(ta.exists())

        if not ta_exists:
            tipo_ta = TipoTextoArticulado.objects.filter(
                content_type=related_object_type).first()

            ta = TextoArticulado()
            ta.tipo_ta = tipo_ta
            ta.content_object = obj

            ta.privacidade = ta_values.get('privacidade', STATUS_TA_EDITION)
            ta.editing_locked = ta_values.get('editing_locked', False)
            ta.editable_only_by_owners = ta_values.get(
                'editable_only_by_owners', False)

        else:
            ta = ta[0]

        if not ta.data:
            ta.data = getattr(obj, map_fields['data']
                              if map_fields['data'] else 'xxx',
                              timezone.now())
            if not ta.data:
                ta.data = timezone.now()

        ta.ementa = getattr(
            obj, map_fields['ementa']
            if map_fields['ementa'] else 'xxx', _(
                'Integração com %s sem ementa.') % obj)

        ta.observacao = getattr(
            obj, map_fields['observacao']
            if map_fields['observacao'] else 'xxx', '')

        now = timezone.now()
        ta.numero = getattr(
            obj, map_fields['numero']
            if map_fields['numero'] else 'xxx', int('%s%s%s' % (
                int(now.year),
                int(now.month),
                int(now.day))))

        ta.ano = getattr(obj, map_fields['ano']
                         if map_fields['ano'] else 'xxx', now.year)

        ta.save()
        return ta