376 # XXX 'infered': True/False, not clear actually |
376 # XXX 'infered': True/False, not clear actually |
377 props.update({'constraints': rdef.constraints, |
377 props.update({'constraints': rdef.constraints, |
378 'description': rdef.description, |
378 'description': rdef.description, |
379 'cardinality': rdef.cardinality, |
379 'cardinality': rdef.cardinality, |
380 'constraints': rdef.constraints, |
380 'constraints': rdef.constraints, |
|
381 'permissions': rdef.get_permissions(), |
381 'order': rdef.order}) |
382 'order': rdef.order}) |
|
383 groupmap = group_mapping(session) |
382 for specialization in eschema.specialized_by(False): |
384 for specialization in eschema.specialized_by(False): |
383 if rschema.has_rdef(specialization, rdef.object): |
385 if (specialization, rdef.object) in rschema.rdefs: |
384 continue |
386 continue |
385 for rql, args in ss.frdef2rql(rschema, str(specialization), |
387 sperdef = RelationDefinitionSchema(specialization, rschema, rdef.object, props) |
386 rdef.object, props): |
388 for rql, args in ss.rdef2rql(rschema, str(specialization), |
|
389 rdef.object, sperdef, groupmap=groupmap): |
387 session.execute(rql, args) |
390 session.execute(rql, args) |
388 # set default value, using sql for performance and to avoid |
391 # set default value, using sql for performance and to avoid |
389 # modification_date update |
392 # modification_date update |
390 if default: |
393 if default: |
391 session.system_sql('UPDATE %s SET %s=%%(default)s' % (table, column), |
394 session.system_sql('UPDATE %s SET %s=%%(default)s' % (table, column), |