[Zope3-dev] Re: RFC II: pre-creation view solution [was Re: [Zope3-dev] RFC: preCreation view, postCreation view use cases]

Gary Poster Gary Poster" <garyposter@earthlink.net
Tue, 2 Apr 2002 22:22:35 -0500


On my separate branch I have merged my code with the current Zope-3x branch:
this also takes advantage of Stephan's recent work this afternoon.  This
means that the create URLs now look like this:

myFolder/ZPTPage;create
myFolder/Image;create

and so on.  Much better!

I also updated my JobBoardEx branch to use Stephan's new code (as well as
using the view/context pt stuff that SteveA did).

Again, interested parties may checkout Zope3 from the
"gary-pre_create_views-branch" branch, and checkout JobBoardEx from
"gary-pre_create_views_example-branch"

If you are curious as to how a canonical create view might look and work,
the default create view in Zope.App.ZMI.Views.Browser is something to
examine.

If you are curious as to how a create view might be used to accomodate a
generic python structure rather than a standard zope3 structure, see the Job
creation view in the JobBoardEx.

The zcml in the JobBoardEx is also the best to look at for an idea of how a
special create view might be set up.

if you want to play with making your own create view, look at the one I
labeled as canonical above, and realize that the context of your view is an
Addable (see Zope.App.ZMI.Addable.py): that means you can use
context/id
context/description
context/title
to get information about what you are adding from the zcml
zmi:factoryFromClass.  It also means you can't get anything else
automatically from the instance-to-be, because, as advertised, it's not
there yet.  (You can generate a temporary instance in a view method if it
helps your need...)

(Thanks, Stephan!)

Gary