equal
deleted
inserted
replaced
1 config['rql-cache-size'] = config['rql-cache-size'] * 10 |
1 config['rql-cache-size'] = config['rql-cache-size'] * 10 |
2 |
2 |
3 add_entity_type('CWDataImport') |
3 add_entity_type('CWDataImport') |
|
4 |
|
5 from cubicweb.schema import CONSTRAINTS, guess_rrqlexpr_mainvars |
|
6 for rqlcstr in rql('Any X,XT,XV WHERE X is CWConstraint, X cstrtype XT, X value XV,' |
|
7 'X cstrtype XT, XT name IN ("RQLUniqueConstraint","RQLConstraint","RQLVocabularyConstraint"),' |
|
8 'NOT X value ~= ";%"').entities(): |
|
9 expression = rqlcstr.value |
|
10 mainvars = guess_rrqlexpr_mainvars(expression) |
|
11 yamscstr = CONSTRAINTS[rqlcstr.type](expression, mainvars) |
|
12 rqlcstr.set_attributes(value=yamscstr.serialize()) |
|
13 print 'updated', rqlcstr.type, rqlcstr.value |