From be1c2e1158410fffb4fa73c92f25f6cd0730dbe1 Mon Sep 17 00:00:00 2001 From: Pepper Date: Sun, 21 Feb 2016 22:59:56 -0500 Subject: going local --- test_db.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test_db.py (limited to 'test_db.py') diff --git a/test_db.py b/test_db.py new file mode 100644 index 0000000..dc694f0 --- /dev/null +++ b/test_db.py @@ -0,0 +1,18 @@ +#!/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 -- cgit v1.2.3-70-g09d2