summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/hosting/server/atomutil.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-08-26 03:04:23 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-08-26 03:04:23 +0000
commit7905926c413e843d9497948cb824059f2c017f6a (patch)
tree0f88f849a2b6a170319b9ba22b6434ab586a1283 /sca-cpp/trunk/hosting/server/atomutil.py
parent64fed3fe80c115c775d45f9b46f661a4d6043e5a (diff)
Support sorting database search results by rank, and add a rank attribute to ATOM entries.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1517412 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/hosting/server/atomutil.py')
-rw-r--r--sca-cpp/trunk/hosting/server/atomutil.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sca-cpp/trunk/hosting/server/atomutil.py b/sca-cpp/trunk/hosting/server/atomutil.py
index 2fbcaff8ce..81cf8dee41 100644
--- a/sca-cpp/trunk/hosting/server/atomutil.py
+++ b/sca-cpp/trunk/hosting/server/atomutil.py
@@ -32,7 +32,7 @@ def title(e):
if isNull(e):
return ()
t = assoc("'title", car(e))
- return None if isNull(t) else cadr(t)
+ return None if isNull(t) or isNull(cdr(t)) else cadr(t)
def entryid(e):
if isNull(e):
@@ -52,6 +52,12 @@ def updated(e):
u = assoc("'updated", car(e))
return None if isNull(u) else cadr(u)
+def rank(e):
+ if isNull(e):
+ return ()
+ r = assoc("'rank", car(e))
+ return None if isNull(r) else cadr(r)
+
def content(e):
if isNull(e):
return ()