[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/Browser - EditView.py:1.3 edit.pt:1.3

Jim Fulton jim@zope.com
Sun, 1 Dec 2002 05:23:04 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Forms/Browser
In directory cvs.zope.org:/tmp/cvs-serv32402

Modified Files:
	EditView.py edit.pt 
Log Message:
Fixed bug in edit view. Edity views didn't generate ObjectModifiedEvents.


=== Zope3/lib/python/Zope/App/Forms/Browser/EditView.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/Forms/Browser/EditView.py:1.2	Sat Nov 30 13:33:52 2002
+++ Zope3/lib/python/Zope/App/Forms/Browser/EditView.py	Sun Dec  1 05:22:33 2002
@@ -16,6 +16,8 @@
 """
 
 from datetime import datetime
+from Zope.Event import publish
+from Zope.Event.ObjectEvent import ObjectModifiedEvent
 from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.App.Forms.Views.Browser import Widget
 from Zope.App.Forms.Exceptions import WidgetsError
@@ -98,6 +100,9 @@
 
         if errors:
             raise WidgetsError(*errors)
+
+        if not unchanged:
+            publish(content, ObjectModifiedEvent(content))
 
         return unchanged
 


=== Zope3/lib/python/Zope/App/Forms/Browser/edit.pt 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/Forms/Browser/edit.pt:1.2	Sat Nov 30 13:33:52 2002
+++ Zope3/lib/python/Zope/App/Forms/Browser/edit.pt	Sun Dec  1 05:22:33 2002
@@ -10,8 +10,10 @@
 
       <div metal:define-macro="formbody">
 
-        <h2 tal:condition="view/label"
-            tal:content="view/label">Edit something</h2>
+        <h3 tal:condition="view/label"
+            tal:content="view/label"
+            metal:define-slot="heading"
+            >Edit something</h3>
 
         <p tal:define="status view/update"
            tal:condition="status"