Re: [Zope-dev] HiperDOM example (objlink, that is) ?
On Fri, Oct 27, 2000 at 07:48:32AM +0200, Gregor Hoffleit wrote: > Hi, > > perhaps I'm too stupid, but I don't grok how the objlink method in the > HiperDOM example has to look like. Could somebody post an example ? You're not too stupid; this isn't documented (yet). Perhaps some people would be inclined to tell you to read the source code and then call you stupid, but not me ;-) The objlink method gets one parameter, which is a DOM Node object (for info on those, look for the docs on the PyXML suite). It is expect to return either a Node object or a string; there is a weird API which allows it to return a dictionary, but you really don't want to use that before the documentation is in place. If you're inclined to reading the source, there's better documentation there (in the form of comments). Look for do_method() in HiperDomStrategies.py []s, |alo + -- Hack and Roll ( http://www.hackandroll.org ) News for, uh, whatever it is that we are. http://zope.gf.com.br/lalo mailto:[EMAIL PROTECTED] pgp key: http://zope.gf.com.br/lalo/pessoal/pgp Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Special Method's
Hi, I have a question on special methods in python. I want to program a product that has many methods. I anyone anywhere is calling one of these methods a other method should be called before. Is there a special method name or is there a way to perform this? as ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] HiperDOM example (objlink, that is) ?
Hi, perhaps I'm too stupid, but I don't grok how the objlink method in the HiperDOM example has to look like. Could somebody post an example ? Gregor ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Unit testing, ZUnit - It is in the fishbowl, please comment
The proposal below is in the fishbowl, at http://dev.zope.org/Wikis/DevSite/Proposals/UnitTestingProducts The approach will be, developing the standalone ZUnit Product while the proposal is in the fishbowl, then push for the proposal (integrating it with App/Product*.py). Expect a first release of ZUnit next week or in the other. In the meanwhile, please comment in the proposal's discussion page :-) (or here) On Mon, Oct 23, 2000 at 10:56:31PM -0200, Lalo Martins wrote: > We (I and Hiperlógica) started to develop a Product we called > ZUnit, intended for XP-style unit-testing Python-based > Products in a full Zope environment (with a real ZODB, REQUEST, > RESPONSE, etc). > > We first conceived it as a kind of Zope-based version of > unittestgui.py - you create a "TestRunner" object giving it the > package, module and name of a TestSuite object generator (see > the PyUnit documentation) and inside it you may click on some > widget to run the tests and produce a "TestResult" object which > you can inspect later. Does this sound like a good design? > > Then I figured in the long run a Product isn't the best > sollution; instead, fiddling with App/Product* sounds more like > it, to allow developers to register tests just like they > register classes, ZClass superclasses, _misc and help. Of > course, just like the current registerHelp and others, it > wouldn't be mandatory and not using it wouldn't break anything. > > Then, in the Product's page in the Control Panel, there would > be a tab "Test", where you'd be allowed to run the unit tests. > > What do people think of this? What does DC think of this? Can I > go ahead and develop it in this direction? []s, |alo + -- Hack and Roll ( http://www.hackandroll.org ) News for, uh, whatever it is that we are. http://zope.gf.com.br/lalo mailto:[EMAIL PROTECTED] pgp key: http://zope.gf.com.br/lalo/pessoal/pgp Brazil of Darkness (RPG)--- http://zope.gf.com.br/BroDar ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Documentation Documentation on dev.zope.org
Hello Zope Developers, I've added two documents to dev.zope.org How to Document Your Zope Product http://dev.zope.org/Documentation/DocsProcedures/ProductDoc How to Document Your Changes to Zope http://dev.zope.org/Documentation/DocsProcedures/ZopeChanges They are wikis so dive in and add your 2 cents. -Amos -- Amos Latteier mailto:[EMAIL PROTECTED] Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Flat Database/ZPatterns api, performance ?
Simon Michael wrote: > Flat Database (was ListMate) is just what I need to whip up an > interface for non-technical administrators - thanks. So I migrated two > data tables ("workshops" & "registrations") from gadfly to flatdb > instances using the CSV import feature, and the admin interface is > working fine. I wrote flat database because I wanted some features ListMate didn't have and didn't want ZClasses. I basically copied the structure from ListMate, so it's probably not the best design possible for ZPatterns. So (1) may not be possible with the current code. Maybe try creating entries like so: ... manage_addEntry doesn't return the new entry. Idon't remember how this works anymore, frankly. The source code is your friend :) -- Itamar S.T. [EMAIL PROTECTED] Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Flat Database/ZPatterns api, performance ?
Flat Database (was ListMate) is just what I need to whip up an interface for non-technical administrators - thanks. So I migrated two data tables ("workshops" & "registrations") from gadfly to flatdb instances using the CSV import feature, and the admin interface is working fine. I'm having a hard time, though, figuring out how to access the data programmatically. I scavenged the docs (zpatterns wiki very helpful, as far as it went; not much available for flatdb), searched the lists (nothing) and grovelled around in the code. I'd appreciate any comments or advice on the following. 1. how can I look up a row in the table by column value, other than searching the whole table: ? 2. how can I add an entry to a table ? I tried this: ... and it seems to create a number of spurious rows with only the first field set. This didn't work either: 3. displaying table contents seems quite slow. On this P100 with 48Mb ram doing nothing but zope, no load and generally snappy, generating the 50-row, 20-column registrations table listing takes 15 seconds. Any ideas about where this comes from ? 4. this is my first encounter with the mighty zpatterns. I wonder how one might add a thing (data plugin ?) so that FlatDb could read the data out of zgadfly or something faster, instead of migrating it as I did ? Many thanks! -Simon ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Path Handler problems
Hi, I've finally gotten around to doing the PathHandler product I mentioned ages ago and now I've run into problems. Since it's so short, here's the product class: class PathHandler( SimpleItem,Persistent,Acquisition.Implicit ): meta_type = 'Path Handler' def __init__(self, id, method_name, title=''): """initialise a new instance of Path Handler""" self.id = id self.title = title self.method_name= method_name def __bobo_traverse__(self, TraversalRequest, name): list=copy(TraversalRequest['TraversalRequestNameStack']) list.reverse() TraversalRequest['path_to_handle']=[name]+list TraversalRequest['TraversalRequestNameStack']=[] return getattr(self,self.method_name) Okay, the confusing bit first. Let's say x is an instance of PathHandler, with method_name = 'the_method'. the_method is a DTML method as follows: If I try the url: http://localhost:7080/x ...I get: Resource not found Traceback (innermost last): File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 222, in publish_module File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 187, in publish File E:\Zope\2271B4~1.2\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 173, in publish File E:\Zope\2271B4~1.2\lib\python\ZPublisher\HTTPResponse.py, line 308, in setBody File E:\Zope\2271B4~1.2\lib\python\ZPublisher\HTTPResponse.py, line 529, in notFoundError NotFound: (see above) If I try the url: http://localhost:7080/x/1 ...I get what I expect, the output of the_method, with path_to_handle set to ['1'] Now, if I try the following url or anythong longer: http://localhost:7080/x/1/2 ...I get: Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:7080/x/1/2 Traceback (innermost last): File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 222, in publish_module File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 187, in publish File E:\Zope\2271B4~1.2\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: the_method) File E:\Zope\2271B4~1.2\lib\python\ZPublisher\Publish.py, line 162, in publish File E:\Zope\2271B4~1.2\lib\python\ZPublisher\BaseRequest.py, line 367, in traverse File E:\Zope\2271B4~1.2\lib\python\ZPublisher\HTTPResponse.py, line 539, in debugError NotFound: (see above) Can anyone (Evan?) suggest what's going on here and what I need to do to fix it? cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Hippos on the Bell Curve ;-)
Michel Pelletier wrote: > > Chris Withers wrote: > > > > Michel Pelletier wrote: > > > > > Python Methods are a perfect example of an object that is useful to us > > > at the top for advanced things, like methods of a animal base class we > > > use in our complex Zoo application, but they are also just as useful to > > > those at the bottom, as a simple little script written in python that > > > feeds the hippos. Or unobfusicates their DTML. Or iterates over a > > > database query. It's useful and saves the time of these novice Zope > > > users if these methods can be flexible and reusable in different > > > contexts. To me, this is the heart of the container vs. context binding > > > argument. We at the top ususaly want the container because we're > > > engineering methods on classes. Those at the bottom usually want > > > context for entirely different reasons. Evan has done a great job > > > making an object that satisfies the entire spectrum, but in the process > > > has come up with something that is not entirely unlike a method in > > > python. > > > > ...this clears things up a lot. So, a python x can be bound to > > containment _or_ context depending on how it's setup, right? > > Sorta. There is a bindings tab on PythonMethods where you assign names > to various variables that show up in your namespace. 'self' is the > container. 'context' is the context. So: > > self.objectValues() > > will allways call the container whereas: > > context.objectValues() > > will call the method on the currently bound object. > > > > > I say leave it to the vote, although I liked that complex voting > > algorithm thing someone posted, it sounds like it'd leave more people > > happier. > > Unfortunately, complex also means "too hard for me to think too hard > about". Any volunteers? That would be me. Sure I'll do it. Just set up the voting page so people can rank their choices, and give me the data afterwards and I'll do the tallying. Michael. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Bindings and Votings
Toby Dickenson wrote: > > As the first line in your PythonMethod: > > self,context = context,self Haha... I forgot what it's like to have real assignment in TTW methods ;-) > But why would you want to? No particular reason, just wondering :-) Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Bindings and Votings
> ...but can you bind self to the context or, more perversely, > context to > the container? As the first line in your PythonMethod: self,context = context,self But why would you want to? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] __replaceable__ or whatever it is ;-)
Chris Withers wrote: > I was wondering how the stuff for attributes that are replaceable in > instance and singleton attributesis getting on. > > Itamar says the code is in the CVS for Zope, but neither of us can find > any documentation. FYI I actually added the docs in two places, but they were promptly removed from the place they did not belong: the help system. Unfortunately the InterfacesWiki is currently the only good place. > Could whoever did the coding please put something in the Interfaces Wiki > or point us to where the official documentation lives? http://www.zope.org/Members/michel/Projects/Interfaces/ObjectManagerItem (See the bottom.) > Also, when is it going to land in a erleased Zoep version? 2.3 I > guess... That's the plan. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Bindings and Votings
Michel Pelletier wrote: > > Sorta. There is a bindings tab on PythonMethods where you assign names > to various variables that show up in your namespace. 'self' is the > container. 'context' is the context. So: > > self.objectValues() > > will allways call the container whereas: > > context.objectValues() > > will call the method on the currently bound object. ...but can you bind self to the context or, more perversely, context to the container? > Unfortunately, complex also means "too hard for me to think too hard > about". Any volunteers? How about the person who suggested it? ;-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Hippos on the Bell Curve ;-)
Chris Withers wrote: > > Michel Pelletier wrote: > > > Python Methods are a perfect example of an object that is useful to us > > at the top for advanced things, like methods of a animal base class we > > use in our complex Zoo application, but they are also just as useful to > > those at the bottom, as a simple little script written in python that > > feeds the hippos. Or unobfusicates their DTML. Or iterates over a > > database query. It's useful and saves the time of these novice Zope > > users if these methods can be flexible and reusable in different > > contexts. To me, this is the heart of the container vs. context binding > > argument. We at the top ususaly want the container because we're > > engineering methods on classes. Those at the bottom usually want > > context for entirely different reasons. Evan has done a great job > > making an object that satisfies the entire spectrum, but in the process > > has come up with something that is not entirely unlike a method in > > python. > > ...this clears things up a lot. So, a python x can be bound to > containment _or_ context depending on how it's setup, right? Sorta. There is a bindings tab on PythonMethods where you assign names to various variables that show up in your namespace. 'self' is the container. 'context' is the context. So: self.objectValues() will allways call the container whereas: context.objectValues() will call the method on the currently bound object. > > I say leave it to the vote, although I liked that complex voting > algorithm thing someone posted, it sounds like it'd leave more people > happier. Unfortunately, complex also means "too hard for me to think too hard about". Any volunteers? -Michel ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Hippos on the Bell Curve ;-)
Michel Pelletier wrote: > Python Methods are a perfect example of an object that is useful to us > at the top for advanced things, like methods of a animal base class we > use in our complex Zoo application, but they are also just as useful to > those at the bottom, as a simple little script written in python that > feeds the hippos. Or unobfusicates their DTML. Or iterates over a > database query. It's useful and saves the time of these novice Zope > users if these methods can be flexible and reusable in different > contexts. To me, this is the heart of the container vs. context binding > argument. We at the top ususaly want the container because we're > engineering methods on classes. Those at the bottom usually want > context for entirely different reasons. Evan has done a great job > making an object that satisfies the entire spectrum, but in the process > has come up with something that is not entirely unlike a method in > python. ...this clears things up a lot. So, a python x can be bound to containment _or_ context depending on how it's setup, right? Okay, if that's the case, then we need to make sure that the situations where you use context binding and the situations where you use containment binding are clearly explained. If Zope is to succeed really well, we should make sure that people at the bottom of the bell-curve don't end up feeding paper to hippos or filling receptions with hippo feed ;-) It's bad if someone rises up the bell curve and then realises all their context-bound methods could be badly abused, they're left feeling stupid and with the impression it's easy to create serious problems with Zope. By the time they've first learn to use python x's, they should know when to use context and when to use containment. > I'm arguing that we need a name that makes sense to > everybody. 'Method' makes sense to us at the top, but not to those on > the bottom, and there are a lot more of those people than us. I say leave it to the vote, although I liked that complex voting algorithm thing someone posted, it sounds like it'd leave more people happier. cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] __replaceable__ or whatever it is ;-)
Hi, I was wondering how the stuff for attributes that are replaceable in instance and singleton attributesis getting on. Itamar says the code is in the CVS for Zope, but neither of us can find any documentation. Could whoever did the coding please put something in the Interfaces Wiki or point us to where the official documentation lives? Also, when is it going to land in a erleased Zoep version? 2.3 I guess... cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] How to use methods in a deeper folder?
Hannes, There are a few ways to do this: or or all have their problems/advantages. try some of the above and see how you get on. hth Phil - Original Message - From: "Loibl Johann" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 26, 2000 1:02 PM Subject: [Zope-dev] How to use methods in a deeper folder? > Hi, > > I would like to use a SQL-Method which exists in a deeper folder; > > e.g. > > in dtml-Method /eins/zwei/index_html there exists > > > > > > and my sqlMethod is situated in folder /eins/zwei/drei/ > > Why doesn't this work? > > Could someone give me a helping hand? > > Cheers, Hannes > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] How to use methods in a deeper folder?
Hi, I would like to use a SQL-Method which exists in a deeper folder; e.g. in dtml-Method /eins/zwei/index_html there exists and my sqlMethod is situated in folder /eins/zwei/drei/ Why doesn't this work? Could someone give me a helping hand? Cheers, Hannes ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] 2 Zopes
> > Hi, > > > > Can anyone tell me a way to get Zope Objects from the first > > Zope-Installation to the second. > > I need this because i have to program a Product to putting data into > > different Zope Installations from one point of the Web. > > My boss want this way because he want a central point for data input, > > where the data are of different type and therefore they have to stored > > in different locations( different Zope Installations) My idea is to use > > ZPublisher.Client, but i don't find a way to use it. > > > > thanks as > > if you need to copy the actual objects verbatim you might want to > investigate exporting to zexp and using file transfer between the hosts > and (using Client to faciltate calling into zope) importing them on the > second server. > The Client/Server Product is probably doing exactly what you want. It uses the Zope Export/Import facility to transfer whole objects from one Zope to another. You find it at www.zope.org/Members/MacGregor/Client_Server maybe you give it a try :) Cheers, Gregor! ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )