server/sources/extlite.py
branchstable
changeset 2062 20f18837107c
parent 2053 fb156d69bfd9
child 2067 668cc93f8578
equal deleted inserted replaced
2061:6a5044f15cb9 2062:20f18837107c
   212         sqlcursor = session.pool[self.uri]
   212         sqlcursor = session.pool[self.uri]
   213         attrs = {SQL_PREFIX + 'eid': eid}
   213         attrs = {SQL_PREFIX + 'eid': eid}
   214         sql = self.sqladapter.sqlgen.delete(SQL_PREFIX + etype, attrs)
   214         sql = self.sqladapter.sqlgen.delete(SQL_PREFIX + etype, attrs)
   215         sqlcursor.execute(sql, attrs)
   215         sqlcursor.execute(sql, attrs)
   216 
   216 
       
   217     def local_add_relation(self, session, subject, rtype, object):
       
   218         """add a relation to the source
       
   219 
       
   220         This is not provided as add_relation implementation since usually
       
   221         source don't want to simply do this, so let raise NotImplementedError
       
   222         and the source implementor may use this method if necessary
       
   223         """
       
   224         sqlcursor = session.pool[self.uri]
       
   225         attrs = {'eid_from': subject, 'eid_to': object}
       
   226         sql = self.sqladapter.sqlgen.insert('%s_relation' % rtype, attrs)
       
   227         sqlcursor.execute(sql, attrs)
       
   228 
       
   229     def add_relation(self, session, subject, rtype, object):
       
   230         """add a relation to the source"""
       
   231         raise NotImplementedError()
       
   232 
   217     def delete_relation(self, session, subject, rtype, object):
   233     def delete_relation(self, session, subject, rtype, object):
   218         """delete a relation from the source"""
   234         """delete a relation from the source"""
   219         rschema = self.schema.rschema(rtype)
   235         rschema = self.schema.rschema(rtype)
   220         if rschema.inlined:
   236         if rschema.inlined:
   221             if subject in session.query_data('pendingeids', ()):
   237             if subject in session.query_data('pendingeids', ()):