added initial fast model implementation

svn: r5872
This commit is contained in:
Richard Taylor
2006-02-03 15:49:59 +00:00
parent 64ba0101d4
commit 754231f151
14 changed files with 1181 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
import gtk
import time
import bsddb
import cPickle
import logging
log = logging.getLogger(".")
from _PathCursor import PathCursor
from _ListCursor import ListCursor
from _FastModel import FastModel
import RelLib
class PersonTreeModel(FastModel):
"""Provides a fast model interface to the Person table.
"""
def __init__(self,db):
FastModel.__init__(self,db)
def _get_table(self,db):
return db.surnames
def _get_cursor(self,db):
return PathCursor(db.surnames.cursor())
def _get_object_class(self,db):
return RelLib.Person
def _get_length(self,db):
return self._table.stat()['nkeys']