diff options
| author | Pepper <pepper@scannerjammer.com> | 2016-02-21 22:59:56 -0500 |
|---|---|---|
| committer | Pepper <pepper@scannerjammer.com> | 2016-02-21 22:59:56 -0500 |
| commit | be1c2e1158410fffb4fa73c92f25f6cd0730dbe1 (patch) | |
| tree | 18cbcf51deadc1dcd9de4b096e819ec23f1453d5 /test_db.py | |
| parent | 1097c275b727d4c55d6243aef3c6849e8f7d126f (diff) | |
going local
Diffstat (limited to 'test_db.py')
| -rw-r--r-- | test_db.py | 18 |
1 files changed, 18 insertions, 0 deletions
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 |
