[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container - adding.py:1.14.2.1

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 14 19:47:00 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv24609/browser/container

Modified Files:
      Tag: dreamcatcher-ttwschema-branch
	adding.py 
Log Message:
Everything works now. To demo it, do:

1. Create a Utility Service.

2. Create a Menu Service

3. Add a Browser Menu and register it as 'add_content'. This will be 
   automated.

4. Create a Persistent Schema Utility (this begs to be renamed). Call it
   'IDocument'. Add some fields.

5. Create a Content Component Defition. Call it 'Document'. 
   Find the IDocument schema and set it to the definitions schema. Make 
   security assertions as desired. Later I will also make all the menu 
   options adjustable.

6. Go to your Content space. There you should see a 'Document' object in 
   the list of available Content Objects. As usual, click on it to create 
   the object.

That's it.

Now it is time to clean up and write tests.


=== Zope3/src/zope/app/browser/container/adding.py 1.14 => 1.14.2.1 ===
--- Zope3/src/zope/app/browser/container/adding.py:1.14	Wed Aug  6 10:41:36 2003
+++ Zope3/src/zope/app/browser/container/adding.py	Thu Aug 14 18:46:24 2003
@@ -94,7 +94,13 @@
         if type_name.startswith('@@'):
             type_name = type_name[2:]
 
-        if zapi.queryView(self, type_name, self.request) is not None:
+        # XXX: Needs tests (SR)
+        if '/' in type_name:
+            view_name  = type_name.split('/', 1)[0]
+        else:
+            view_name = type_name
+
+        if zapi.queryView(self, view_name, self.request) is not None:
             url = "%s/%s=%s" % (
                 zapi.getView(self, "absolute_url", self.request),
                 type_name, id)




More information about the Zope3-Checkins mailing list