equal
deleted
inserted
replaced
54 cstrent = session.entity_from_eid(cstreid) |
54 cstrent = session.entity_from_eid(cstreid) |
55 cstr = CONSTRAINTS[cstrent.type].deserialize(cstrent.value) |
55 cstr = CONSTRAINTS[cstrent.type].deserialize(cstrent.value) |
56 cstr.eid = cstreid |
56 cstr.eid = cstreid |
57 constraints.append(cstr) |
57 constraints.append(cstr) |
58 return constraints |
58 return constraints |
|
59 |
|
60 def group_mapping(cw): |
|
61 try: |
|
62 return cw.transaction_data['groupmap'] |
|
63 except KeyError: |
|
64 cw.transaction_data['groupmap'] = gmap = ss.group_mapping(cw) |
|
65 return gmap |
59 |
66 |
60 def add_inline_relation_column(session, etype, rtype): |
67 def add_inline_relation_column(session, etype, rtype): |
61 """add necessary column and index for an inlined relation""" |
68 """add necessary column and index for an inlined relation""" |
62 table = SQL_PREFIX + etype |
69 table = SQL_PREFIX + etype |
63 column = SQL_PREFIX + rtype |
70 column = SQL_PREFIX + rtype |
809 for rtype in (META_RTYPES - VIRTUAL_RTYPES): |
816 for rtype in (META_RTYPES - VIRTUAL_RTYPES): |
810 rschema = schema[rtype] |
817 rschema = schema[rtype] |
811 sampletype = rschema.subjects()[0] |
818 sampletype = rschema.subjects()[0] |
812 desttype = rschema.objects()[0] |
819 desttype = rschema.objects()[0] |
813 props = rschema.rdef(sampletype, desttype) |
820 props = rschema.rdef(sampletype, desttype) |
814 relrqls += list(ss.rdef2rql(rschema, name, desttype, props)) |
821 relrqls += list(ss.rdef2rql(rschema, name, desttype, props, |
|
822 groupmap=group_mapping(self._cw))) |
815 # now remove it ! |
823 # now remove it ! |
816 schema.del_entity_type(name) |
824 schema.del_entity_type(name) |
817 # create the necessary table |
825 # create the necessary table |
818 for sql in tablesql.split(';'): |
826 for sql in tablesql.split(';'): |
819 if sql.strip(): |
827 if sql.strip(): |