[Zope-CVS] CVS: Products/Ape/lib/apelib/sql - classification.py:1.5
Shane Hathaway
shane@zope.com
Wed, 9 Jul 2003 11:40:41 -0400
Update of /cvs-repository/Products/Ape/lib/apelib/sql
In directory cvs.zope.org:/tmp/cvs-serv4933/lib/apelib/sql
Modified Files:
classification.py
Log Message:
Merged ape-newconf-branch. Mappers are now configured using XML.
=== Products/Ape/lib/apelib/sql/classification.py 1.4 => 1.5 ===
--- Products/Ape/lib/apelib/sql/classification.py:1.4 Mon May 19 15:32:34 2003
+++ Products/Ape/lib/apelib/sql/classification.py Wed Jul 9 11:40:06 2003
@@ -27,11 +27,11 @@
schema = FieldSchema('classification', 'classification')
- table_base_name = 'classification'
+ table_base_name = 'classification2' # Version 2
column_defs = (
- ('meta_type', 'string', 0),
('class_name', 'string', 0),
+ ('mapper_name', 'string', 0),
)
def load(self, event):
@@ -41,9 +41,9 @@
if items:
rec = items[0]
if rec[0]:
- classification['meta_type'] = rec[0]
+ classification['class_name'] = rec[0]
if rec[1]:
- classification['class_name'] = rec[1]
+ classification['mapper_name'] = rec[1]
else:
raise NoStateFoundError(key)
return classification, rec
@@ -51,14 +51,12 @@
def store(self, event, classification):
key = long(event.getKey())
items = self.execute(event, 'read', 1, key=key)
- mt = classification.get('meta_type', '')
cn = classification.get('class_name', '')
- kw = {'key': key, 'meta_type': mt, 'class_name': cn}
+ mn = classification.get('mapper_name', '')
+ kw = {'key': key, 'class_name': cn, 'mapper_name': mn}
if items:
- # update.
self.execute(event, 'update', **kw)
else:
- # insert.
self.execute(event, 'insert', **kw)
- return (mt, cn)
+ return (cn, mn)