web/views/ajaxcontroller.py
changeset 9784 790956c311ef
parent 9492 c7fc56eecd1a
child 10215 96085e379066
--- a/web/views/ajaxcontroller.py	Wed May 28 17:57:40 2014 +0200
+++ b/web/views/ajaxcontroller.py	Fri Mar 07 14:03:44 2014 +0100
@@ -460,3 +460,15 @@
     """
     cookiename, cookievalue = str(cookiename), str(cookievalue)
     self._cw.set_cookie(cookiename, cookievalue)
+
+
+
+@ajaxfunc
+def delete_relation(self, rtype, subjeid, objeid):
+    rql = 'DELETE S %s O WHERE S eid %%(s)s, O eid %%(o)s' % rtype
+    self._cw.execute(rql, {'s': subjeid, 'o': objeid})
+
+@ajaxfunc
+def add_relation(self, rtype, subjeid, objeid):
+    rql = 'SET S %s O WHERE S eid %%(s)s, O eid %%(o)s' % rtype
+    self._cw.execute(rql, {'s': subjeid, 'o': objeid})