server/schemaserial.py
branchstable
changeset 3876 1169d3154be6
parent 3857 6676a839dc97
child 3877 7ca53fc72a0a
child 3897 6421a0050234
equal deleted inserted replaced
3875:c2bd7922cdaf 3876:1169d3154be6
   520     """
   520     """
   521     etype = isinstance(erschema, schemamod.EntitySchema) and 'CWEType' or 'CWRType'
   521     etype = isinstance(erschema, schemamod.EntitySchema) and 'CWEType' or 'CWRType'
   522     for action in erschema.ACTIONS:
   522     for action in erschema.ACTIONS:
   523         for group in sorted(erschema.get_groups(action)):
   523         for group in sorted(erschema.get_groups(action)):
   524             try:
   524             try:
   525                 yield ('SET X %s_permission Y WHERE X is %s, X name "%s", Y eid %s'
   525                 yield ('SET X %s_permission Y WHERE X is %s, X name %%(name)s, Y eid %s'
   526                        % (action, etype, erschema, groupmapping[group]), None)
   526                        % (action, etype, groupmapping[group]), {'name': str(erschema)})
   527             except KeyError:
   527             except KeyError:
   528                 continue
   528                 continue
   529         for rqlexpr in sorted(erschema.get_rqlexprs(action)):
   529         for rqlexpr in sorted(erschema.get_rqlexprs(action)):
   530             yield ('INSERT RQLExpression E: E expression %%(e)s, E exprtype %%(t)s, '
   530             yield ('INSERT RQLExpression E: E expression %%(e)s, E exprtype %%(t)s, '
   531                    'E mainvars %%(v)s, X %s_permission E '
   531                    'E mainvars %%(v)s, X %s_permission E '