Commits

Anonymous committed 406d91f Merge

Merge

  • Participants
  • Parent commits 4d62ae8, 2af19c6

Comments (0)

Files changed (1)

flask_durus/durus.py

 
         return """<html><head><title>%s</title></head><body><div>%s</div><div>%s</div></body></html>""" % (repr(value).replace('<', '&lt;').replace('>','&gt;'), repr(value).replace('<', '&lt;').replace('>','&gt;'), format(persistent_vars(value)))
 
+class Index(BTree):
+    def _with_limit(self, method, *args,  **kws):
+        """
+        Overload this so that only the item returned is the object as the last item in the index key.
+        """
+        for key, value in BTree._with_limit(self, method, *args, **kws):
+            yield key[-1]
 
 class IndexedKeyed(Keyed):
     """
 
                 key=tuple(key)
                 print "key [%s]" % str(key)
-                self._keep._indexes.setdefault(name, BTree())[key] = None
+                self._keep._indexes.setdefault(name, Index())[key] = None
 
                 # store pointer back into index
                 self._indexes[name] = key