diff options
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 |
