comparison roundup/backends/back_metakit.py @ 3365:e2d65f6c8d83

handle dropped properies in rdbms/metakit journal export [SF#1203569]
author Richard Jones <richard@users.sourceforge.net>
date Fri, 24 Jun 2005 06:38:14 +0000
parents 35def80077ba
children c1c67c62b699
comparison
equal deleted inserted replaced
3363:7bc1e9c42a26 3365:e2d65f6c8d83
1 # $Id: back_metakit.py,v 1.95 2005-06-08 03:41:46 anthonybaxter Exp $ 1 # $Id: back_metakit.py,v 1.96 2005-06-24 06:38:14 richard Exp $
2 '''Metakit backend for Roundup, originally by Gordon McMillan. 2 '''Metakit backend for Roundup, originally by Gordon McMillan.
3 3
4 Known Current Bugs: 4 Known Current Bugs:
5 5
6 - You can't change a class' key properly. This shouldn't be too hard to fix. 6 - You can't change a class' key properly. This shouldn't be too hard to fix.
1703 r = [] 1703 r = []
1704 for nodeid in self.getnodeids(): 1704 for nodeid in self.getnodeids():
1705 for nodeid, date, user, action, params in self.history(nodeid): 1705 for nodeid, date, user, action, params in self.history(nodeid):
1706 date = date.get_tuple() 1706 date = date.get_tuple()
1707 if action == 'set': 1707 if action == 'set':
1708 export_data = {}
1708 for propname, value in params.items(): 1709 for propname, value in params.items():
1710 if not properties.has_key(propname):
1711 # property no longer in the schema
1712 continue
1713
1709 prop = properties[propname] 1714 prop = properties[propname]
1710 # make sure the params are eval()'able 1715 # make sure the params are eval()'able
1711 if value is None: 1716 if value is None:
1712 pass 1717 pass
1713 elif isinstance(prop, Date): 1718 elif isinstance(prop, Date):
1714 value = value.get_tuple() 1719 value = value.get_tuple()
1715 elif isinstance(prop, Interval): 1720 elif isinstance(prop, Interval):
1716 value = value.get_tuple() 1721 value = value.get_tuple()
1717 elif isinstance(prop, Password): 1722 elif isinstance(prop, Password):
1718 value = str(value) 1723 value = str(value)
1719 params[propname] = value 1724 export_data[propname] = value
1725 params = export_data
1720 l = [nodeid, date, user, action, params] 1726 l = [nodeid, date, user, action, params]
1721 r.append(map(repr, l)) 1727 r.append(map(repr, l))
1722 return r 1728 return r
1723 1729
1724 def import_journals(self, entries): 1730 def import_journals(self, entries):

Roundup Issue Tracker: http://roundup-tracker.org/