new first_level_keywords method on Classification
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 22 Sep 2009 11:48:54 +0200
changeset 63 fdb298a5503a
parent 62 de70dc39d97f
child 64 1cefc6b8bb8f
new first_level_keywords method on Classification
entities.py
--- a/entities.py	Fri Sep 18 12:39:32 2009 +0200
+++ b/entities.py	Tue Sep 22 11:48:54 2009 +0200
@@ -40,6 +40,11 @@
         """returns true if this node has no parent"""
         return True
 
+    def first_level_keywords(self):
+        return self.req.execute('Any K,N ORDERBY N WHERE K included_in C, '
+                                'NOT K subkeyword_of KK, K name N, '
+                                'C eid %(x)s', {'x': self.eid})
+
 
 class Keyword(TreeMixIn, AnyEntity):
     id = 'Keyword'