git://git.onelab.eu
/
unfold.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
delete_local_user available from rest, check if user is a pi of the authority for...
[unfold.git]
/
rest
/
__init__.py
diff --git
a/rest/__init__.py
b/rest/__init__.py
index
a856596
..
c348483
100644
(file)
--- a/
rest/__init__.py
+++ b/
rest/__init__.py
@@
-1,5
+1,6
@@
from manifold.core.query import Query
from manifoldapi.manifoldapi import execute_query
from manifold.core.query import Query
from manifoldapi.manifoldapi import execute_query
+from portal.actions import is_pi
from django.http import HttpResponse
from django.http import HttpResponse
@@
-45,8
+46,7
@@
class ObjectRequest(object):
table = self.type.split(':')
prefix = table[0]
table = table[1]
table = self.type.split(':')
prefix = table[0]
table = table[1]
-
- if prefix is 'local':
+ if prefix == 'local':
# XXX TODO: find a generic Query to get the fields like
# select column.name from local:object where table == local:user
table = self.type.split(':')
# XXX TODO: find a generic Query to get the fields like
# select column.name from local:object where table == local:user
table = self.type.split(':')
@@
-114,6
+114,8
@@
class ObjectRequest(object):
query.filter_by(k, '<=', f[2:])
elif (f[:1] == "<") :
query.filter_by(k, '<', f[1:])
query.filter_by(k, '<=', f[2:])
elif (f[:1] == "<") :
query.filter_by(k, '<', f[1:])
+ elif (f[:8] == "CONTAINS") :
+ query.filter_by(k, 'CONTAINS', f[8:])
else :
query.filter_by(k, '==', f)
return query
else :
query.filter_by(k, '==', f)
return query