#!/usr/bin/python2.7 from photoblaster.db.imcmd import ImCmd #ok so what is it exactly that we want to test, creating a session and doing a simple #query? #imcmd is the name of the table, by the way yeah need to create a session and try to supply not ImCmd, but variable which contain it #ok so should I use that first db.py module I showed you? or do it directly from sqlalchemy any will doing from photoblaster.db import Db import simplejson as json db = Db({ table: ImCmd }) print map(lambda n: n.serialize(), db.search(**{ 'tag': 'PbPattern' })) #ok looks better so far, right? yeah we can also hide table into self . something like this...seems better? yep #is this helpful at all? yeah, now we need to change it so we provide not imcmd, but variable with it inside. works #ok where does this search method go? Db class? yes looks so #what should it return? probably should rename serialze to as_dict right? no need, just return results as is