Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

root/branches/crazycache/dejavu/storage/storepsycopg.py

Revision 542 (checked in by fumanchu, 4 years ago)

Doc work and a missing import.

  • Property svn:eol-style set to native
Line 
1
2 from geniusql.providers import psycopg
3 from dejavu.storage import db, multischema
4
5
6 class StorageManagerPsycoPg(db.StorageManagerDB):
7     """StoreManager to save and retrieve Units via psycopg2."""
8    
9     databaseclass = psycopg.PsycoPgDatabase
10    
11     def __init__(self, allOptions={}):
12         for atom in allOptions['connections.Connect'].split(" "):
13             k, v = atom.split("=", 1)
14             if k == "dbname":
15                 allOptions['name'] = v
16         db.StorageManagerDB.__init__(self, allOptions)
17
18
19 class MultiSchemaStorageManagerPg(multischema.MultiSchemaStorageManagerDB):
20     """StoreManager to save and retrieve multiple schemas via psycopg2."""
21    
22     databaseclass = psycopg.PsycoPgDatabase
23    
24     def __init__(self, allOptions={}):
25         for atom in allOptions['connections.Connect'].split(" "):
26             k, v = atom.split("=", 1)
27             if k == "dbname":
28                 allOptions['name'] = v
29         multischema.MultiSchemaStorageManagerDB.__init__(self, allOptions)
30
Note: See TracBrowser for help on using the browser.