diff options
author | Federico Di Gregorio <fog@initd.org> | 2004-10-19 03:17:12 +0000 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2004-10-19 03:17:12 +0000 |
commit | c904d97f696a665958c2cc43333d09c0e6357577 (patch) | |
tree | de88cb1cb6a48230f79bc0b532835d26a33660e9 /ZPsycopgDA/DABase.py | |
download | psycopg2-c904d97f696a665958c2cc43333d09c0e6357577.tar.gz |
Initial psycopg 2 import after SVN crash.
Diffstat (limited to 'ZPsycopgDA/DABase.py')
-rw-r--r-- | ZPsycopgDA/DABase.py | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/ZPsycopgDA/DABase.py b/ZPsycopgDA/DABase.py new file mode 100644 index 0000000..03102c3 --- /dev/null +++ b/ZPsycopgDA/DABase.py @@ -0,0 +1,67 @@ +# ZPsycopgDA/DABase.py - ZPsycopgDA Zope product: Database inspection +# +# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# Or, at your option this program (ZPsycopgDA) can be distributed under the +# Zope Public License (ZPL) Version 1.0, as published on the Zope web site, +# http://www.zope.org/Resources/ZPL. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. +# +# See the LICENSE file for details. + +import sys +import Shared.DC.ZRDB.Connection + +from db import DB +from Globals import HTMLFile +from ImageFile import ImageFile +from ExtensionClass import Base +from DateTime import DateTime + +# import psycopg and functions/singletons needed for date/time conversions + +import psycopg +from psycopg.extensions import INTEGER, LONGINTEGER, FLOAT, BOOLEAN +from psycopg import NUMBER, STRING, ROWID, DATETIME + + + +class Connection(Shared.DC.ZRDB.Connection.Connection): + _isAnSQLConnection = 1 + + info = None + + #manage_options = Shared.DC.ZRDB.Connection.Connection.manage_options + ( + # {'label': 'Browse', 'action':'manage_browse'},) + + #manage_tables = HTMLFile('tables', globals()) + #manage_browse = HTMLFile('browse',globals()) + + def __getitem__(self, name): + if name == 'tableNamed': + if not hasattr(self, '_v_tables'): self.tpValues() + return self._v_tables.__of__(self) + raise KeyError, name + + + ## old stuff from ZPsycopgDA 1.1 (never implemented) ## + + def manage_wizard(self, tables): + "Wizard of what? Oozing?" + + def manage_join(self, tables, select_cols, join_cols, REQUEST=None): + """Create an SQL join""" + + def manage_insert(self, table, cols, REQUEST=None): + """Create an SQL insert""" + + def manage_update(self, table, keys, cols, REQUEST=None): + """Create an SQL update""" |