hooks/metadata.py
changeset 3720 5376aaadd16b
parent 3399 2b84f4adb6f8
child 3724 e5ab08bb0d60
--- a/hooks/metadata.py	Thu Oct 15 11:20:26 2009 +0200
+++ b/hooks/metadata.py	Mon Oct 19 15:16:41 2009 +0200
@@ -80,14 +80,18 @@
         session = self._cw
         entity = self.entity
         try:
-            session.add_relation(entity.eid, 'is',
-                                 eschema_type_eid(session, entity.__regid__))
+            #session.add_relation(entity.eid, 'is',
+            #                     eschema_type_eid(session, entity.__regid__))
+            session.system_sql('INSERT INTO is_relation(eid_from,eid_to) VALUES (%s,%s)'
+                           % (entity.eid, eschema_type_eid(session, entity.id)))
         except IndexError:
             # during schema serialization, skip
             return
         for etype in entity.e_schema.ancestors() + [entity.e_schema]:
-            session.add_relation(entity.eid, 'is_instance_of',
-                                 eschema_type_eid(session, etype))
+            #session.add_relation(entity.eid, 'is_instance_of',
+            #                     eschema_type_eid(session, etype))
+            session.system_sql('INSERT INTO is_instance_of_relation(eid_from,eid_to) VALUES (%s,%s)'
+                               % (entity.eid, eschema_type_eid(session, etype)))
 
 
 class SetOwnershipHook(MetaDataHook):