Make nodes comparable (yikes).
This commit is contained in:
parent
ff444daf0a
commit
e80cb442e4
1 changed files with 6 additions and 0 deletions
|
@ -109,6 +109,12 @@ class Node:
|
|||
self.url = '/node/' + self.uri
|
||||
self.subnodes = []
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.wikilink.lower() < other.wikilink.lower()
|
||||
|
||||
def __gt__(self, other):
|
||||
return self.wikilink.lower() > other.wikilink.lower()
|
||||
|
||||
def size(self):
|
||||
return len(self.subnodes)
|
||||
|
||||
|
|
Loading…
Reference in a new issue