misc/migration/3.14.0_Any.py
author Julien Cristau <julien.cristau@logilab.fr>
Wed, 22 Oct 2014 14:39:51 +0200
changeset 10098 e8889211f256
parent 8483 4ba11607d84a
child 10589 7c23b7de2b8d
permissions -rw-r--r--
[web] Stop patching jquery.treeview.js This logically reverts part of e9b7cd2e9012 "allow treeview to work correctly in a tab #345293". The treeview and ajax code have suffered a number of changes since then, this change doesn't seem to be necessary anymore. It is most likely unneeded since f65208c9dbdc "[javascript] use jQuery.one('ajax-loaded') instead of jQuery.bind() in add_onload to avoid multiple callback executions".

config['rql-cache-size'] = config['rql-cache-size'] * 10

add_entity_type('CWDataImport')

from cubicweb.schema import CONSTRAINTS, guess_rrqlexpr_mainvars
for rqlcstr in rql('Any X,XT,XV WHERE X is CWConstraint, X cstrtype XT, X value XV,'
                   'X cstrtype XT, XT name IN ("RQLUniqueConstraint","RQLConstraint","RQLVocabularyConstraint"),'
                   'NOT X value ~= ";%"').entities():
    expression = rqlcstr.value
    mainvars = guess_rrqlexpr_mainvars(expression)
    yamscstr = CONSTRAINTS[rqlcstr.type](expression, mainvars)
    rqlcstr.cw_set(value=yamscstr.serialize())
    print 'updated', rqlcstr.type, rqlcstr.value.strip()