~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/sqlobject/__init__.py

  • Committer: James Henstridge
  • Date: 2008-03-06 10:17:05 UTC
  • mto: (5821.4.1 storm-integration)
  • mto: This revision was merged to the branch mainline in revision 6481.
  • Revision ID: james.henstridge@canonical.com-20080306101705-avqp6vylt5iyseqc
* Remove psycopgda, sqlobject and sqlos from lib/ directory.
* Remove sqlos ZCML initialisation from package-includes/.
* Add stub sqlobject module that imports stuff from storm.sqlobject.
* Move the Storm database adapter code to old c/l/webapp/adapter module.
* Add Storm tracers to manage timeouts and statement logging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2008 Canonical Ltd.  All rights reserved.
 
2
 
 
3
"""Expose the Storm SQLObject compatibility layer."""
 
4
 
 
5
__metaclass__ = type
 
6
 
 
7
from storm.sqlobject import *
 
8
 
 
9
# Provide the same interface from these other locations.
 
10
import sys
 
11
sys.modules['sqlobject.joins'] = sys.modules['sqlobject']
 
12
sys.modules['sqlobject.sqlbuilder'] = sys.modules['sqlobject']
 
13
del sys
 
14
 
 
15
def sqlrepr(obj, dbname=None):
 
16
    assert dbname in [None, 'postgres']
 
17
    from storm.databases.postgres import compile
 
18
    return compile(obj)