|
From: Blake W. <bl...@ph...> - 2003-02-04 16:47:46
|
Responding to some comments from Wari, Our Glorious Leader:
> I need an API for storage.
Okay, here's a first pass at the storage api.
----------------->8 storageApi.py 8<--------------------
"""
This module defines the api that any class implementing storage must
conform to.
"""
class Storage:
# Storage types.
COMMENT = 1
TRACKBACK = 2
PINGBACK = 3
SENT_TRACKBACK = 4
SENT_PINGBACK = 5
def allFilter( entry ):
return true
def get( self, type, entryId, filter=allFilter ):
# Returns a list of all the data for that entry,
# filtered by the filter.
pass
def store( self, type, entryId, data ):
# Stores a bit of data of the specified type for the
# passed-in entry.
pass
def search( self, searchTerm, type=None, entryId=None ):
# Searches in the specified type and entry (if supplied)
# for data containing the passed-in search term.
pass
----------------->8 storageApi.py 8<--------------------
|