Martijn wrote:
Then we add the user interface with DTML. After some initial learning with DTML, this step is easy too. It's just a question of importing DocumentTemplate and adding a single attribute to the class (index_html). Minor stumbling block is that the non Zope python doesn't have the Zope modules on its module search path. Adding them resolves this; I'm not sure however if I fixed it completely (insert completely vague failures and complaints here :).
You should use the Zope debugger for writing Zope Products: http://www.zope.org/Documentation/Reference/Debugger It's the Python debugger with enhancements to jump right to your object being published, with a carefully crafted environment resembling an HTTP request. With this you are back in the (for you familiar) world of Python, Emacs, and pdb. Is this a useful thing for you?
You can test the generated HTML easily in a python test function, then. Minor step.
Then we have a publishable object. We can test it with a test_poll.py file that creates the object to be published. We can call the Zope debugger to see if it all comes out okay. No problem.
Now we try to make the leap from publishable object to Zope product. The tutorial says there is a long way between these two; and there is!
The big gap trouble starts here. Suddenly, we don't import DocumentTemplate anymore, instead we do a 'from globals import HTMLFile' for general DTML support. We also import a number of other things. Suddenly I can't test anything anymore - not with a python test function or with the zope debugger, it seems. I get an error message that complains about the variable 'trueself' that was omitted from the request.
Ahh, I see. If you *could* stick with the Zope debugger, would this be an answer for you?
So after this I can't test things anymore. I still need to make a creation form and a product installation method. In the tutorial it mentions the process of turning publishable product into product is a bit tedious and that in the future there will perhaps be a more streamlined process. I hope this future arrives soon, as after this,
Obviously we're open to specific suggestions about improving it.
still without apparant ability to test, I need to add a producting editing form, a product editing method, define Zope permissions, management tabs, a meta type, and a product icon. The system gives no
This is *precisely* the kind of feedback we need.
feedback on any of these. Then finally, I can install the poll and test it.
We realize that we aren't making it friendly at all for people to write products. In fact, we are probably making it so hard that I should send out medals to those that do it :^)
This is too big a bound for me, somehow. I am able to do all the steps, but I keep getting bogged down, starting over, knowing I can't test anything yet. It breaks the quick Python development cycle; it's even slower than my C++ development cycle. There are too many steps that don't seem to fit into my short term memory. Part of the program design I do during prototyping. I can't seem to do this with products.
It's a shame we haven't articulated it very well because it really is a pretty Pythonic way of doing things. However, it currently is about like writing Python apps without the library reference.
A way to resolve this would be:
* A lot more practice by me. I'm doing this. :)
* A way to test each step somewhat better. Feedback from Zope telling you if you're still on the right course.
Hmm, explain.
* A more automated process of poll creation. I'm starting to think about what this should look like. I can probably eventually help with design/implementation, if I keep butting my head at product creation enough.
I believe Amos suggested something like this previously. Basically, something that would ask you a few questions then write out a bunch of prototype code.
* I'm missing something. "Martijn, when I create a product I do so and then so and it's really easy and quick."
* products are beyond Martijn's feeble mind and he just should give up. :)
Never!
I want to see more products for Zope. I want to *make* products for Zope. If it were easier somehow, there would be more products for Zope, which would be good for everybody.
Ahh, now you are sweet-talking us. :^)
Enough of my lament. I hope it helps somebody else; otherwise ignore all as frustration relief. And again, I do like Zope.
It's hard for us to know where to start. We got a <FLAME> yesterday from the exact opposite: more examples with no Python, all DTML. We also get complaints about debugging the process of getting it started (apparently Apache configuration is our business as well). It's hard to know where to start, as it is all important. Do you feel that a format like Amos' tutorial is the best one? Or a bunch of sample products? Or a reference guide? --Paul Paul Everitt Digital Creations paul@digicool.com 540.371.6909