equal
deleted
inserted
replaced
5 rql('SET X is_instance_of Y WHERE X is Y, NOT X is_instance_of Y') |
5 rql('SET X is_instance_of Y WHERE X is Y, NOT X is_instance_of Y') |
6 commit() |
6 commit() |
7 |
7 |
8 if confirm('fix existing cwuri?'): |
8 if confirm('fix existing cwuri?'): |
9 from logilab.common.shellutils import progress |
9 from logilab.common.shellutils import progress |
10 from cubicweb.server.session import hooks_control |
|
11 rset = rql('Any X, XC WHERE X cwuri XC, X cwuri ~= "%/eid/%"') |
10 rset = rql('Any X, XC WHERE X cwuri XC, X cwuri ~= "%/eid/%"') |
12 title = "%i entities to fix" % len(rset) |
11 title = "%i entities to fix" % len(rset) |
13 nbops = rset.rowcount |
12 nbops = rset.rowcount |
14 enabled = interactive_mode |
13 enabled = interactive_mode |
15 with progress(title=title, nbops=nbops, size=30, enabled=enabled) as pb: |
14 with progress(title=title, nbops=nbops, size=30, enabled=enabled) as pb: |