[Zope-dev] Re: Read-only root database doesn't work ... bug or
feature?
Paul Winkler
pw_lists at slinkp.com
Mon May 24 17:15:42 EDT 2004
On Mon, May 24, 2004 at 06:55:02PM +0200, Dieter Maurer wrote:
Content-Description: message body and .signature
> Martijn Faassen wrote at 2004-5-24 09:50 +0200:
> > ...
> >I know this has been reported before but I haven't looked into it yet.
> >I'm wondering how to handle Formulator upgrades though -- just checking
> >if you've been registered in a previous startup is not enough if the
> >help text changes between releases, is it?
> >
> >It's been a long time since I worked with the Zope help system..
>
> I attach my previous patch. It may no longer work, though.
It doesn't apply cleanly to Formulator 1.6.2 (the one that
ships with plone 2.0-final). But it's easy to apply the rejects
by hand. Updated patch attached, can you verify that this
does what your patch intended?
I applied this, but it doesn't solve the ReadOnlyError :-(
--
Paul Winkler
http://www.slinkp.com
-------------- next part --------------
Only in Formulator-PATCHED: #FieldRegistry.py#
diff -c Formulator/FieldHelpTopic.py Formulator-PATCHED/FieldHelpTopic.py
*** Formulator/FieldHelpTopic.py Tue Mar 16 12:06:46 2004
--- Formulator-PATCHED/FieldHelpTopic.py Mon May 24 16:59:06 2004
***************
*** 33,35 ****
--- 33,57 ----
"""
return self.field_class.form.get_fields_in_group(group)
+
+ def __eq__(self,other):
+ try:
+ gs= self.get_groups()
+ if gs != other.get_groups(): return 0
+ for g in gs:
+ fs= self.get_fields_in_group(g)
+ ofs= other.get_fields_in_group(g)
+ if len(fs) != len(ofs): return 0
+ for i in range(len(fs)):
+ f= fs[i]; of= ofs[i]
+ if f.id != of.id \
+ or f.get_value('title') != of.get_value('title') \
+ or f.get_value('description') != of.get_value('description'):
+ return 0
+ return 1
+ except AttributeError: return 0
+
+
+ def __ne__(self,other): return not (self == other)
+
+
Only in Formulator-PATCHED: FieldHelpTopic.py.orig
diff -c Formulator/FieldRegistry.py Formulator-PATCHED/FieldRegistry.py
*** Formulator/FieldRegistry.py Tue Mar 16 12:06:46 2004
--- Formulator-PATCHED/FieldRegistry.py Mon May 24 17:04:37 2004
***************
*** 50,64 ****
getattr(field_class, 'internal_field')):
continue
- # unregister any help topic already registered
- if field_name in help.objectIds('Help Topic'):
- help._delObject(field_name)
# register help topic
ht = FieldHelpTopic(field_name,
"Formulator Field - %s" % field_name,
field_class)
context.registerHelpTopic(field_name, ht)
def initializeFields(self):
--- 50,66 ----
getattr(field_class, 'internal_field')):
continue
# register help topic
ht = FieldHelpTopic(field_name,
"Formulator Field - %s" % field_name,
field_class)
+ # unregister, if necessary
+ if field_name in help.objectIds('Help Topic'):
+ if ht == help._getOb(field_name): continue
+ help._delObject(field_name)
+
context.registerHelpTopic(field_name, ht)
def initializeFields(self):
Only in Formulator-PATCHED: FieldRegistry.py.ORIG
Only in Formulator-PATCHED: FieldRegistry.py.orig
Only in Formulator-PATCHED: __init__.py.ORIG
Common subdirectories: Formulator/dtml and Formulator-PATCHED/dtml
Common subdirectories: Formulator/help and Formulator-PATCHED/help
Common subdirectories: Formulator/tests and Formulator-PATCHED/tests
Common subdirectories: Formulator/www and Formulator-PATCHED/www
More information about the Zope-Dev
mailing list