<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">from patch.include import *
from tqdm import tqdm


@app_context(commit=True)
def patch():
    """РџРѕРјРµС‡Р°РµРј РґРѕРєСѓРјРµРЅС‚С‹ РєР°Рє РёРјРїРѕСЂС‚РёСЂРѕРІР°РЅРЅС‹Рµ РґР»СЏ РІРѕР·РјРѕР¶РЅРѕСЃС‚Рё РїРµСЂРµРёРјРїРѕСЂС‚Р°"""
    _filter = [['name', 'LIKE', '%drawio'], ['parent.import_original', '==', None]]
    done = []
    for attach in tqdm(models.CmfAttachment.list(filter=_filter, fields=['parent.import_original'])):
        if attach.parent.code.value in done:
            continue
        done.append(attach.parent.code.value)
        attach.parent.import_original = True
        attach.parent.value.save(only_data=True)
    print(done)


if __name__ == "__main__":
    patch()
</pre></body></html>