cubicweb/misc/migration/3.23.0_Any.py
changeset 12825 71a842bdf81d
parent 11846 7e03f38c8d5f
equal deleted inserted replaced
12824:bc623a3e44e9 12825:71a842bdf81d
    59 for cwconstraint in rql('Any C WHERE R constrained_by C').entities():
    59 for cwconstraint in rql('Any C WHERE R constrained_by C').entities():
    60     cwrdef = cwconstraint.reverse_constrained_by[0]
    60     cwrdef = cwconstraint.reverse_constrained_by[0]
    61     rdef = cwrdef.yams_schema()
    61     rdef = cwrdef.yams_schema()
    62     cstr = rdef.constraint_by_eid(cwconstraint.eid)
    62     cstr = rdef.constraint_by_eid(cwconstraint.eid)
    63     with cnx.deny_all_hooks_but():
    63     with cnx.deny_all_hooks_but():
    64         cwconstraint.cw_set(value=unicode(cstr.serialize()))
    64         cwconstraint.cw_set(value=str(cstr.serialize()))
    65     if cstr.type() not in ('BoundaryConstraint', 'IntervalBoundConstraint',
    65     if cstr.type() not in ('BoundaryConstraint', 'IntervalBoundConstraint',
    66                            'StaticVocabularyConstraint'):
    66                            'StaticVocabularyConstraint'):
    67         # These cannot be translate into backend CHECK.
    67         # These cannot be translate into backend CHECK.
    68         continue
    68         continue
    69     cstrname, check = check_constraint(rdef, cstr, helper, prefix='cw_')
    69     cstrname, check = check_constraint(rdef, cstr, helper, prefix='cw_')