Hi there. First I have to say that Im very glad that this group exists. Now the problem: Im a zope newbie and have startet making a product solely through Python (leaving the management interface behind!). Inside my product object I want to make a folder containing images. My problem is that when I create folders and images through Python it aint visible in the management interface. How to I make them visible? Secund, can someone explain to me what implicit objects are available so Im able to communicate with Zope (I have had a hard time trying to figure out howto communicate with Zope through a Python product - the docs API aint well documented) regards Danny -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Im a zope newbie and have startet making a product solely through Python (leaving the management interface behind!). Inside my product object I want to make a folder containing images. My problem is that when I create folders and images through Python it aint visible in the management interface. How to I make them visible?
Objects which are merely attributes of an object won't show up in the ZMI. (It would be a neat trick though.) For the ZMI to see it, it has to be done in a 'folderish' manner. When you have some folderish object you want to add an object to, you say folder.manage_addXXX(id, title, ...) where XXX is the name of the product, and the elipsis is the rest of the arguments. Some products use a non-'manage_' naming convention: check the source/api docs/add form. You'll have to anyway to check the arguments. If you are in a folderish object, you would replace the 'folder' above with 'self'. If you want to know more about this machinery, look at _setObject in ObjectManager. To look into a folderish object, you use the object[Items/Values/Ids] methods, which you probably know about already.
Secund, can someone explain to me what implicit objects are available so Im able to communicate with Zope (I have had a hard time trying to figure out howto communicate with Zope through a Python product - the docs API aint well documented)
I'm not quite sure what you're looking for here, but maybe you want to take a look at the Globals.py and App/*.py, especially Common.py and Product.py. --jcc
Danny Nielsen wrote at 2003-3-1 11:06 +0100:
... Inside my product object I want to make a folder containing images. My problem is that when I create folders and images through Python it aint visible in the management interface. How to I make them visible?
You use the methods designed for this purpose. I hope they are documented in the Zope Developers Guide (to be found on "zope.org"). You need the 'ObjectManager' method "_setObject(id,obj)". It puts "obj" into the object manager under "id". That other Zope things work find with "obj", it must have the id "id".
Secund, can someone explain to me what implicit objects are available so Im able to communicate with Zope (I have had a hard time trying to figure out howto communicate with Zope through a Python product - the docs API aint well documented)
What? What do you mean with "implicit objects"? I suggest reading the following literature: * the Zope book, 2.6 edition (--> Zope.org) * the Zope Developers Guide (--> Zope.org) * <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> Dieter
At 02:06 AM 3/1/2003, Danny Nielsen wrote:
Now the problem: Im a zope newbie and have startet making a product solely through Python
Nothing like jumping right in.... :-)
(leaving the management interface behind!).
Really?
Inside my product object I want to make a folder containing images.
I'm pretty sure you don't. We'll see, though.
My problem is that when I create folders and images through Python it aint visible in the management interface. How to I make them visible?
Make them Zope objects, not parts of your product instance. The data in your product is only displayed if it is somehow referenced or created by your product's interface.
Secund, can someone explain to me what implicit objects are available so Im able to communicate with Zope
Not sure what those would be, to be honest.
the docs API aint well documented
Perhaps not, but I don't think that's the essential problem here. Every once in a while, newbies ask how to do something that seems simple and some crusty old timer feels the need to tell them they're going about it all wrong. Well, here goes: it sounds like you're going about this all wrong. Don't worry, though... it's all part of the learning process. First off, products are not a replacement for the Zope Management Interface (ZMI). All you do when you create a product is give yourself the ability to add a new type of object through the ZMI. But just doing that is a very powerful thing. A product should be created when you have a need for something that exhibits a certain set of distinct behaviors that aren't easily created with existing objects. It's possible, for example, that you've come up with a need for folders and images that are just too special to be implemented with boring old built-in folder objects and image objects. Possible, but unlikely. More likely, you've made the assumption that there's a need (or advantage) to build monolithic do-everything objects, one per application or site. You *could* work that way, but you'll be missing a whole lot of the point of Zope and re-implementing stuff that other very smart people have already gone to the trouble of creating, testing, debugging and supporting. What I would recommend is *not* starting by building your own products. That would be a bit like picking up a programming language without bothering with the standard libraries. Out of the box, Zope provides a wide range of flexible and powerful objects that can do a heck of a lot of stuff. It's worth knowing about because it's powerful stuff to use and provides examples of some of the best thinking in Zope. Understanding what these built-ins are and how they work will pay off big time when you get to building your own stuff. No longer will you need to worry about how to create and serve your own folders and images, you'll know how to access and manipulate the built-in ones, which are likely to be well suited for your needs. That will leave you free to focus your development time on building the things that Zope doesn't already give you. This is not to say there's no possible reason to want to build your own folders and images... it gets done all the time. I've done it too. But it's not probably where you want to start and when you get there, you'll learn that you're probably talking about three products, not one. And by then you'll know how to use the 99% of the built-in folder that works great and tweak the 1% you want to work differently. I'd check out the Zope Book (both versions): http://www.zope.org/Documentation/Books/ZopeBook/ Dieter's book: http://www.dieter.handshake.de/pyprojects/zope/index.html#bct_sec_1 And the Zope Dev Guide, when you're feeling up to it: http://www.zope.org/Documentation/Books/ZDG/current/index_html After that, the best way to learn about how to make products is to download a bunch of them and rip into the source code. By the time you're able to figure how CMF works, you'll be a jedi master. That may not have been what you were looking for, but I hope it helps. Dylan
participants (4)
-
Danny Nielsen -
Dieter Maurer -
Dylan Reinhardt -
J Cameron Cooper