Re: [Zope-dev] Observable Interface?
Tres Seaver wrote: Chris Withers [EMAIL PROTECTED] asked: Does anyone know what happened to it and how far its implementation got? The preliminary implementaion, DefaultObservabale, landed as a mix-in class in Zope 2.2: $ZOPE_HOME/lib/python/OFS/DefaultObservable.py Mix it in to one of your Python base classes (be sure to get it's '__init__()' called!) and fire away. Where are the docs? Hwo does it work? I am currenly working on the more ambitious notion of adding an event channel, which addresses some of the "MxN" problems which plague the classic Observer. See the Zope-PTK archives for August for the latest on that. Looked... any further progress? 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] Re: Discussion Story Building Mediums
Michael Bernstein wrote: After some more thought, I realized that this really needs to be a three-way gateway betrween a mailing list, a 'blog, and a newsgroup. I'm all up for doing the mailing list/weblog type bits but I have no idea how news _works_ and how it could be integrated into the Zope environment... Any ideas? 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] RFClarification: Security on Product Attributes
Okay, apologies in advance for picking up a thread that's been dorman for so long ;-) Jim Fulton wrote: Chris Withers wrote: self.id = id self.title = 'Title!' self.anInt = 0 self.aString = 'testing' None of the values above can have a __roles__ attribute, so they are covered by assertions made in their containers. That's what I thought Note that if you can't adequately control something that can't have __roles__, you can provide an access function (e.g. getAnInt), which you can control Can I read them? I think the answer is yes for anInt and no for aString. Probably, if you can get at one, you can get at the other. That's not my experience. If you try and use strings, you get dialog boxes popping up. If you use ints, it works fine. So, the problem is how to protect ints when you don't want people to get at them... Adding accessors mean you have protected accessors bu there's nothing to stop you just going and using the freely available original attribute. Strings; fine, at least they're secure, and when they become proper objects in Python 2.0, the problem should go away? 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] Observable Interface?
On Fri, 10 Nov 2000, Chris Withers wrote: Tres Seaver wrote: Chris Withers [EMAIL PROTECTED] asked: Does anyone know what happened to it and how far its implementation got? The preliminary implementaion, DefaultObservabale, landed as a mix-in class in Zope 2.2: $ZOPE_HOME/lib/python/OFS/DefaultObservable.py Mix it in to one of your Python base classes (be sure to get it's '__init__()' called!) and fire away. Where are the docs? Hwo does it work? The docs are in the interfaces wiki: http://www.zope.org/Members/michel/Interfaces/ObserverAndNotification (Note that this actually predates the fishbowl process -- this has been in Zope for a lng time). I am currenly working on the more ambitious notion of adding an event channel, which addresses some of the "MxN" problems which plague the classic Observer. See the Zope-PTK archives for August for the latest on that. Looked... any further progress? Nope, the PTK work I have been able to do lately is all stabilization. I am working an a new "PTK Fishbowl" site, where such proposals can be tracked more cleanly. Tres. -- === Tres Seaver[EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.zope.org ___ 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] Observable Interface?
Tres Seaver wrote: The docs are in the interfaces wiki: http://www.zope.org/Members/michel/Interfaces/ObserverAndNotification (Note that this actually predates the fishbowl process -- this has been in Zope for a lng time). Actually at: http://www.zope.org/Members/michel/Projects/Interfaces/ObserverAndNotification /pedant ;-) Does this mean all of the classes in the diagram at that URL have been implemented? How come the Catalog doesn't use it so CatalogAware (bleugh!) isn't needed anymore? Also, is there any documentation about how to actually use the Observable interface? (excuse my ignorance if I've missed it...) Nope, the PTK work I have been able to do lately is all stabilization. I am working an a new "PTK Fishbowl" site, where such proposals can be tracked more cleanly. Cool :-) 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] RFClarification: Security on Product Attributes
Chris Withers wrote: Okay, apologies in advance for picking up a thread that's been dorman for so long ;-) Jim Fulton wrote: Chris Withers wrote: self.id = id self.title = 'Title!' self.anInt = 0 self.aString = 'testing' None of the values above can have a __roles__ attribute, so they are covered by assertions made in their containers. That's what I thought Note that if you can't adequately control something that can't have __roles__, you can provide an access function (e.g. getAnInt), which you can control Can I read them? I think the answer is yes for anInt and no for aString. Probably, if you can get at one, you can get at the other. That's not my experience. There's something very odd going on. The issue isn't stringness or intness but role-less-ness. :) If you try and use strings, you get dialog boxes popping up. If you use ints, it works fine. I've never seen this. So, the problem is how to protect ints when you don't want people to get at them... Adding accessors mean you have protected accessors bu there's nothing to stop you just going and using the freely available original attribute. Yes there is. Access to attributes is controlled by the roles if their container. You should also be able to create specific unprotected attribute assertions using the mechanism described in: http://www.zope.org/Members/michel/Projects/Interfaces/ZopeSecurityPolicy I'll admit that I haven't tried this. If you try it soon (like today) and find it broken, we can fix it for Zope 2.2.3. Strings; fine, at least they're secure, and when they become proper objects in Python 2.0, the problem should go away? Will Python 2.0 let you assign string attributes? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! Technical Director (888) 344-4332http://www.python.org Digital Creationshttp://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ 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] Exceptions
I was just building in some error handling into some UI code, and wanted to catch errors relating to duplicate ids. The problem is that just about every client-side error raises the same kind of Exception, a 'Bad Request'. A quick grep counted 41 different types of 'Bad Request' in my Zope source. Wouldn't it be *much* nicer to have a hierarchy of exception types, so that applications can deal with them at an arbitrarily granular level? e.g. ZopeException | `RequestException | | | `XMLException | `IdException | | | `ReservedWordException | `DuplicateException Has this discussion taken place before? Would it be useful? Would its effort:benfits ratio be too great to justify doing? seb ___ 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] Exceptions
Oh if only!!! I love this idea, and comments haev coem from DC along those same lines, btu nothing ever really happened about it... cheers, Chris seb bacon wrote: I was just building in some error handling into some UI code, and wanted to catch errors relating to duplicate ids. The problem is that just about every client-side error raises the same kind of Exception, a 'Bad Request'. A quick grep counted 41 different types of 'Bad Request' in my Zope source. Wouldn't it be *much* nicer to have a hierarchy of exception types, so that applications can deal with them at an arbitrarily granular level? e.g. ZopeException | `RequestException | | | `XMLException | `IdException | | | `ReservedWordException | `DuplicateException Has this discussion taken place before? Would it be useful? Would its effort:benfits ratio be too great to justify doing? seb ___ 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 )
Re: [Zope-dev] Fw: 2gb file size
Itamar Shtull-Trauring wrote: Shane Hathaway wrote: Not long ago I created a wrapper around File objects which automatically splits the file before it reached a predefined limit. It could handle any number of partitioned file segements. Yes please! Perhaps it could be integrated into the ZODB codebase while you're at it? I'm working on cleaning it up so that it integrates cleanly with FileStorage. Then I'll release it. BTW your roadmap document is fantastic. I hope you're getting lots of good feedback. It really brings everything together. 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] Exceptions
snip good idea about exception hierarchies Oh if only!!! I love this idea, and comments haev coem from DC along those same lines, btu nothing ever really happened about it... If there are people willing to work on this, then a proposal would be most welcome... http://dev.zope.org/Wikis/DevSite/Proposals/FrontPage Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 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 )
[Zope-dev] RFC : ZPatterns Customer Relationship Management Framework
Thanks a lot for all the guidance on ZPatterns so far. Our company is building a Customer Relationship Management system using ZOPE and ZPatterns. We have a object model and basic Dataskins and Specialists in place. At this point we thought it a good idea to share the object model with the Zope community and invite comments since we will be giving it back to the Zope community. Go to http://www.zope.org/Members/sparroy/CRM to download a pdf of the model and make some comments. Roché ___ 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] ZODB, Threads and Persistence
Hi. Reading from Jims 'Introduction to the Zope Database': "An object's state may be freed at any time by the ZODB to conserve memory usage." What does this mean? That the object can be freed even though there are references to it? The reason I'm asking is becase I want to use threads and persistence together. I would like to inherit both threading.Thread and Persistence.Persistent, but that gives an error. I guess thats because of the ExtentionClass. However, if i only inherit Persistence.Persistent and starts a thread using the thread module withing the persistent class, what will happen with it? Can the ZODB still decide to free my persistent object even thoght it has a reference to a thread that is running?? Or can I start my thread when the object first is used, and rely on that it will be running until I stop it or remove any reference to it? /Magnus ___ 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] Best way to start on ZPatterns ?
Hi Nigel, Yes.. the example still works. I am working on an update that incorporates some of the suggestions folks have made and better illustrates some ZPatterns concepts. Basically the example is *too* simple, and it doesn't separate PD, and UI issues very well.. -steve "Nigel" == Nigel Head [EMAIL PROTECTED] writes: Nigel OK, I've finally got a little leisure to re-assess my way Nigel of making Zope apps (which so far has been 99.9% ZClasses) Nigel and it seems the way to go might be ZPatterns. In true Zope Nigel tradition the docs (at least the simple docs) seem to leave Nigel quite a steep learning curve :-) Nigel After searching the zope-dev mail for a while I've happened Nigel on the thread from Steve S. describing the simplest example Nigel he could think of. Is this still a valid example for the Nigel current version of ZPatterns? Nigel -- Nigel Head Houbits Hi-Tech Servers [EMAIL PROTECTED] Nigel ___ Zope-Dev Nigel maillist - [EMAIL PROTECTED] Nigel http://lists.zope.org/mailman/listinfo/zope-dev ** No cross Nigel posts or HTML encoding! ** (Related lists - Nigel http://lists.zope.org/mailman/listinfo/zope-announce Nigel 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] [Fwd: [Zope] DataSkin Supplier?]
Erk... meant this for zope-dev :-S Chris Withers wrote: Hello... Okay, I'm still staring up at the ZPatterns learning cliff as I write this so forgive my ignorance. I'm looking at ZPatterns WRT to 'dynamically generated dataskins'. You what? Well, okay, I'll try and explain... Firstly, I'm assuming that DataSkins (or their subclasses?) are first-class zope objects, can be 'added', copied, pasted, have security tabs, can be catalogued, URL traversed, etc, etc. Is that assumption correct? I hope so :-S If it is, is there something which can generate DataSkins on the fly? ie: in the same way an AttributeProvider supplier attributes to an object, is there something like a 'DataSkin provider' which provides whole dataskins to a folderish object? Finally, and this is the important bit. Can one of these folderish objects also _be_ a DataSkin? So, to word it differently, there is a root 'DataSkin provider'. This provides DataSkins which are folderish and are also 'DataSkin providers' themselves. Why do I want this? Well, think objects in a tree where the parents/children are stored as a list of names refering to other objects. In addition, objects may have multiple parents, etc... Any ideas? Where should I start reading? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ 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] RFClarification: Security on Product Attributes
Jim Fulton wrote: Strings; fine, at least they're secure, and when they become proper objects in Python 2.0, the problem should go away? Will Python 2.0 let you assign string attributes? % python Python 2.0 (#3, Oct 26 2000, 15:07:09) [GCC 2.95.2 19991024 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. a='' a.foo='bar' Traceback (most recent call last): File "stdin", line 1, in ? TypeError: object has read-only attributes -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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] Observable Interface?
On Fri, 10 Nov 2000, Chris Withers wrote: Does this mean all of the classes in the diagram at that URL have been implemented? How come the Catalog doesn't use it so CatalogAware (bleugh!) isn't needed anymore? Heh, because we would have to make far-reaching changes (essentially, add an event channel :) to make CA redundant; otherwise, the catalog has no way to know *which* objects to observe (not to mention the problem of maintaining tens of thousands of point-to-point subscriptions within the catalog). Chris Petrilli is working on a fishbowl proposal for CatalogNG; I'm pretty sure he intends to adopt some kind of observer/event scheme to make it work. Also, is there any documentation about how to actually use the Observable interface? (excuse my ignorance if I've missed it...) Again, the wiki is it; the code deployed in Zope 2.2 implements the Observable interface, and is intended to be used as a mix-in, like so: from OFS.SimpleItem import SimpleItem from OFS.DefaultObservable import DefaultObservable class Foo( SimpleItem, DefaultObservable ): """ Some foo or other """ ... def bar( self, ... ): """ """ ... self.notify( "bar" ) Clients register with a Foo instance using the methods of the Observable interface, e.g.: foo.registerObserver( self.getPhysicalPath() + ( 'watchFoo',) ) When the Foo instance has its 'bar()' method called, it will notify all registered observers, passing 'bar' as the event; in this case, the client's 'watchFoo()' method will be called, with the foo object and 'bar' passed as parameters. (Thanks for the prodding -- I just checked in a docstring containing the substance of this email.) Tres. -- === Tres Seaver[EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.zope.org ___ 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] ZODB, Threads and Persistence
AFAIK, you should be able to spawn a new thread from within any function within Zope and manipulate stuff in the ZODB as long as you lock properly. The number of database connections is fixed, but arbitrary threads can take up a database connection on an ad-hoc basis. If I were you, I'd mess around a little bit by spawning threads within a Product, and causing the thread to manipulate ZODB objects, keeping locking in mind. I've done this on a limited basis and it seems to work. Specifically, an object may be "ghosted" if it hasn't been accessed in a while. That doesn't mean its state goes away, it just means that it needs to reload its state when it's accessed again. Your manipulation of the object in a separate thread should prevent the object from being ghosted. - Original Message - From: "Magnus Heino (Rivermen)" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 10, 2000 10:35 AM Subject: [Zope-dev] ZODB, Threads and Persistence Hi. Reading from Jims 'Introduction to the Zope Database': "An object's state may be freed at any time by the ZODB to conserve memory usage." What does this mean? That the object can be freed even though there are references to it? The reason I'm asking is becase I want to use threads and persistence together. I would like to inherit both threading.Thread and Persistence.Persistent, but that gives an error. I guess thats because of the ExtentionClass. However, if i only inherit Persistence.Persistent and starts a thread using the thread module withing the persistent class, what will happen with it? Can the ZODB still decide to free my persistent object even thoght it has a reference to a thread that is running?? Or can I start my thread when the object first is used, and rely on that it will be running until I stop it or remove any reference to it? /Magnus ___ 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] Re: question re problem adding zwiki webs
Re this error when adding a zwiki web: Error Type: KeyError Error Value: H?v`H?v$y_?-006412673360557 Content-Disposition: form-data; name="wiki_type" basic Tony McDonald [EMAIL PROTECTED] writes: It is a Mac actually. IE 5.0. I've just asked a colleague to try creating a ZWikiWeb on his PC and it's worked fine! I do have other problems with IE 5.0 in that it has a limit on the number of things I can 'copy' and 'paste' - in general I don't bother doing it and export and reimport folders etc. I'd really like to know why it's behaving like that, I do have a *lot* of cookies in my IE and have also heard that the sequence in which HTTP headers are sent to IE can be an issue to (sigh) Thanks, that helps a lot! To narrow it down, if not to solve it :( It does appear that the problem is not with zwiki, but that HTTP form data headers are being sent in some unusual format and confusing zope. I wonder if you experience mac-IE-specific problems with other zope forms or forms in general. I suppose it could be related to your cut/paste problems. I'm cc'ing the list, perhaps someone knows more. Cheers, -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 )
Re: [Zope-dev] DTML processing variable
If this is your exact code, it looks like you should be using "sequence-item", instead of "sequence_item". You should also be able to do it without the external method like this: (100% untested) dtml-in expr="_.string.split(acctUsersEmail)" dtml-var name="sequence-item" /dtml-in "David W. Damon" wrote: Hey all, I'm having difficulty getting dtml-in to iterate over a list of strings returned from an external python method. Essentially, I have a string that is comprised of the contents of an HTML text area. I need to split the string into a list of words and iterate over this list. My external python method is this: def stringSplit( self, theString ): return string.split( theString ) Heres the pertinent DTML. --- dtml-call expr="REQUEST.set( 'userList', stringSplit(acctUsersEmail))" dtml-in userList dtml-var sequence_item /dtml-in dtml-var REQUEST --- If I comment out the dtml-in block, i have a userList variable in the REQUEST object that is something like: ['name1', 'name2', 'name3'] Any ideas? -- dave ___ 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 ) -- Paul Erickson | [EMAIL PROTECTED] Kaivo, Inc. | www.kaivo.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] ZODB, Threads and Persistence
AFAIK, you should be able to spawn a new thread from within any function within Zope and manipulate stuff in the ZODB as long as you lock properly. I guess I wasn't clear enough, but my application isnt within zope, im just using zodb and some more components out of it. Specifically, an object may be "ghosted" if it hasn't been accessed in a while. That doesn't mean its state goes away, it just means that it needs to reload its state when it's accessed again. Your manipulation of the object in a separate thread should prevent the object from being ghosted. But I guess this still will be the same anyway. That is, if an object inhereted from Persistence.Persistance spawns a thread that manipulated data in the object, I will have no problems. The thread will be running just fine, and the data will be stored in the zodb. ? /Magnus - Original Message - From: "Magnus Heino (Rivermen)" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 10, 2000 10:35 AM Subject: [Zope-dev] ZODB, Threads and Persistence Hi. Reading from Jims 'Introduction to the Zope Database': "An object's state may be freed at any time by the ZODB to conserve memory usage." What does this mean? That the object can be freed even though there are references to it? The reason I'm asking is becase I want to use threads and persistence together. I would like to inherit both threading.Thread and Persistence.Persistent, but that gives an error. I guess thats because of the ExtentionClass. However, if i only inherit Persistence.Persistent and starts a thread using the thread module withing the persistent class, what will happen with it? Can the ZODB still decide to free my persistent object even thoght it has a reference to a thread that is running?? Or can I start my thread when the object first is used, and rely on that it will be running until I stop it or remove any reference to it? /Magnus ___ 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 ) -- /Magnus Heino ___ 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] ZODB, Threads and Persistence
But I guess this still will be the same anyway. That is, if an object inhereted from Persistence.Persistance spawns a thread that manipulated data in the object, I will have no problems. The thread will be running just fine, and the data will be stored in the zodb. This is how I've experienced it. :-) ___ 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] Security/Acquisition Bug? (take two)
I had posted about this previously, but no one has tackled this one, it seems to be a pretty serious issue, plus I've done a *lot* of poking around and learned a few things since I first reported it. What I have *not* found (or been told) is that the below described behavior is normal. First a simple exercise for those who would like to avoid my laborious novice Zoper description and just ferret out the likely bug: Create a fresh CVS copy of Zope on your *nix box. Build it (python wo_pcgi.py), configure 'start' with the ports of your choosing, set a superuser password, start Zope and try to visit the /index_html page. What I'm getting at that point is a BASICAUTH login box. One has to explicitly enable anonymous permissions on the index_html page in order to view it without logging in. I've read through all the security model discussion I could find, but saw no discussion of this issue. If somehow this behavior is intentional, I would greatly appreciate a clue to that effect. (Some response either way would be nice, actually...) Based on my recent flailings with LoginManager and finally, stock acl_users in Zope v2.2.cvs, it seems there this problem relates to the "scope" of acl_users and/or its parent folder not including the objects within. The security settings of the parent folder are apparently not regarded in determining access to objects within. Instead, acl_users is only impacting its sibling objects (and presumably their child objects). Apologies if I'm making the wrong noises in the wrong place in the wrong way. Any help or pointers welcome. -cw- -- ~ Charlie Wilkinson - [EMAIL PROTECTED] - N3HAZ Parental Unit, UNIX Admin, Homebrewer, Cat Lover, Spam Fighter, HAM, SWLer... Visit the Radio For Peace International Website: http://www.rfpi.org/ ~ CLOBBER INTERNET SPAM: See!! http://spam.abuse.net/ Join!! http://www.cauce.org/ ~ QOTD: "Bush is a big corporation disguised as a human being running for president." -- Ralph Nader on David Letterman (9/28/00) ___ 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] PythonMethods: Can't Slice context.REQUEST.PARENTS
I cannot slice context.REQUEST.PARENTS The reason I want to do this is to travel up the URL tree for a breadcrumb navigation do-hicky. I want to slice it so I can make a copy because if I just do ...reverse() on it, I screw up everything afterwards. It says I'm unauthorized (Guarded.py __careful_getattr__) so I assume this is a feature. I suppose I can just .reverse() it back again at the end, but it seems.wrong some how. Attached is my code at the moment...it sucks, I know. This is python project numero uno and zope project duo... If anyone has a better example of how to hand text (I'm using buff and returning it) back, I'd appreciate it. I'm much to tired, so off I go to bed... Ciao! -- Man is the best computer we can put aboard a spacecraft ... and the only one that can be mass produced with unskilled labor. -- Wernher von Braun The Doctor What: fill in the blank http://docwhat.gerf.org/ [EMAIL PROTECTED] KF6VNC paramsbuff='',lose=1/params """ This is a breadcrumb generator. A breadcrumb trail is what you get at yahoo as you traverse downward in their directory structure: computers-video-blah-etc. It shows you where you are in your site. My breadcrumbs shall follow these rules: 1) The current DTML Document shall be the last item. It will not be a link. 2) If the current DTML Document isn't index_html, then the parent crumb will be the index_html for the folder 3) All crumb names are overridable by setting the 'nickname' attribute. 4) The root folder will always be called "Home" Ciao! [EMAIL PROTECTED] """ ## Start being crumb-y! buff = "\n!-- start Breadcrumbs --\n[ " # Get the list of parents and reverse it list = context.REQUEST.PARENTS[:] list.reverse() # Iterate over all the parent objects, skipping the 'current'one # (see below for dealing with that for x in range(lose,len(list)-1): obj = list[x] url = obj.absolute_url() name = obj.title_or_id() buff = "%s\n - a href='%s'%s/a" % (buff, url, name) # Deal with the 'current' object(s) obj = list[-1] buff = "%s\n'%s'" % (buff, obj) buff = "%s\n'%s'" % (buff, context.id) if obj != context: buff = "%s\n - '%s'" % (buff, obj.title_or_id()) buff = "%s\n - '%s'" % (buff, obj.title_or_id()) buff = buff + "\n]\n!-- end Breadcrumbs --\n" return buff
[Zope] Populating a :list variable from the results of a ZSQL method
Hi all, Say I've got a form with this in it select type="checkbox" name="options:list" option value="1"number 1 option value="2"number 2 option value="3"number 3 /select When this is put into an SQL database, the field 'options' is this (string) ['1', '2', '3'] or ['2', '3'] etc. When I get the data back from the database, 'options' comes back as a string, and dtml-in options ... /dtml-in gives errors (basically, it can't iterate over a string). I tried dtml-call "REQUEST.set('new_options:list', options)" and then tried iterating over new_options, but the variable didn't exist... Has anyone got any solutions for this? TIA Tone -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] still problems w/ SiteAccess 2.0.0b3
On Thu, 9 Nov 2000, The Doctor What wrote: I'm curious, you posted a message about SiteAccess. I have the same problem, with Debian (Zope 2.2.2 and I've tried SiteAccess 2.0.0b3 and b4). for some reason, the debian SiteAccess package didn't contains some files of the original SiteAccess tar ball. I just installed it from the tgz file and it worked out of the box! I even posted a msg to the debian-user list without success :-( hth []s, Mario O.de Menezes"Many are the plans in a man's heart, but IPEN-CNEN/SP is the Lord's purpose that prevails" http://curiango.ipen.br/~mario Prov. 19.21 http://www.revistalinux.com.br ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] direct login after signup?
Hi zopers, Is there a syntax to login a user in python? i use a python method to add a user to the acl_user folder. When this is done I want to log in the new user directly. Is that possible? TIA Philipp Dunkel
Re: [Zope] XML Document DTML's tree, HiperDOM
Shane Hathaway wrote: Here's my guess: you have a complex XML document. As you explore the document, Zope is setting a cookie that reflects the list of branches you have opened. After opening a large number of branches, you reach the limit on the size of a cookie (somewhere in the range of 1024 or 4096 bytes), making it so that the compressed data stored in the cookie gets truncated. zlib then emits this cryptic error message. Is this dtml-tree being bad again? If so, how the session information proposal/project getting along? Oh yeah, while I'm here, how's the HiperDOM project getting on? That stuff would be raally useful for a project here... cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Populating a :list variable from the results of a ZSQL method
Tony McDonald wrote: When this is put into an SQL database, the field 'options' is this (string) ['1', '2', '3'] or ['2', '3'] etc. So you're storing the sequence as a string of the type shown above... ...ow ;-) Might be best to change your SQL Schema so your store one row per option... Nasty hack external method: def eval_options(self): return eval(self.REQUEST['options']) then you can do: dtml-in eval_options ...but be careful with that external method, it could be used to do all sorts of bad things if it gets into the wrong hands. cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Bulk Mailing How-To!
For those who care: I have created a bulk mailing How-To at http://www.zope.org/Members/shh/BulkMailHack/ Cheers, Stefan -- Things work better when plugged in ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Populating a :list variable from the results of a ZSQL method
don't know about inside zope, but in plain python you could just do: new_options = list(options) perhaps an external method would cut it: return list(inputstring) -- Geir Bækholt web-developer/designer [EMAIL PROTECTED] http://www.funcom.com on Friday, November 10, 2000 Tony McDonald wrote : TM Hi all, TM Say I've got a form with this in it TM select type="checkbox" name="options:list" TM option value="1"number 1 TM option value="2"number 2 TM option value="3"number 3 TM /select TM When this is put into an SQL database, the field 'options' is this (string) TM ['1', '2', '3'] or ['2', '3'] etc. TM When I get the data back from the database, 'options' comes back as a TM string, and dtml-in options ... /dtml-in gives errors (basically, TM it can't iterate over a string). TM I tried TM dtml-call "REQUEST.set('new_options:list', options)" TM and then tried iterating over new_options, but the variable didn't exist... TM Has anyone got any solutions for this? TM TIA TM Tone TM -- TM Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ TM The Medical School, Newcastle University Tel: +44 191 222 5116 TM A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope TM ___ TM Zope maillist - [EMAIL PROTECTED] TM http://lists.zope.org/mailman/listinfo/zope TM ** No cross posts or HTML encoding! ** TM (Related lists - TM http://lists.zope.org/mailman/listinfo/zope-announce TM http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZCatalog and random key error
On Fri, 10 Nov 2000, Bak @ kedai wrote: also, will iterating through catalog index faster than iterating through ..say.. objectItems('meta-type')? Much faster. Much, much faster. I tried an objectValues() on 2000 items (in 3 different folder-type objects) and did various calculations on each object, it took me 20 sec. to render the page. On the same box the Catalog return a search (much wider than the one on 2000 objects) on 15000 items (indexd, natuarally) within a second or two. Hm. I might be getting out on thin ice now, but I think it depends on what you want to do with the objects you get back from your iteration. If you just are looking for simple attributes, the Catalog should suffice, but it (the Catalog) might be slower if you are doing something with the objects, since it has to fetch them first - and the objectValues() returns the object. I'm not sure about this, though, the source code should help you a lot (I think objectValues() and objectItems() and those alike are in lib/python/ObjectManager.py - around line 350). Come to think of it. You did say objectItems(), and I've described the objectValues(). I don't think you can compare the Catalog and objectItems(), since objectItems() returns a list of (id, subobject) tuples and thus gives you context - something the Catalog cannot do (unless you hack it.. yeah Catalog wizards?). I might be wrong though :) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Populating a :list variable from the results of a ZSQL method
tone, How about (untested): where 'dboptions' is the string pulled from the DB, and 'options' is the list needed. dtml-call "REQUEST.set('options',[])" dtml-in "_.string.split(dboptions[1:-1],',')" dtml-call "options.append(_.int(_['sequence-item']))" /dtml-in This would then give you take the string "['1','2','3']" and turn it into the list [1,2,3]. hth Phil - Original Message - From: "Tony McDonald" [EMAIL PROTECTED] To: "Zope List" [EMAIL PROTECTED] Sent: Friday, November 10, 2000 10:10 AM Subject: [Zope] Populating a :list variable from the results of a ZSQL method Hi all, Say I've got a form with this in it select type="checkbox" name="options:list" option value="1"number 1 option value="2"number 2 option value="3"number 3 /select When this is put into an SQL database, the field 'options' is this (string) ['1', '2', '3'] or ['2', '3'] etc. When I get the data back from the database, 'options' comes back as a string, and dtml-in options ... /dtml-in gives errors (basically, it can't iterate over a string). I tried dtml-call "REQUEST.set('new_options:list', options)" and then tried iterating over new_options, but the variable didn't exist... Has anyone got any solutions for this? TIA Tone -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How do I set the Title property of a File object from aDTML method
On 10 Nov 2000 [EMAIL PROTECTED] wrote: But I'm unable to set the Title property of a File object. Is it just the title property? All the others you can fiddle around with? Try manage_changeProperties() instead. I know (from lib/python/OFS/Image.py) that the File object has its own manage_edit() method, you could try that one. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Populating a :list variable from the results of a ZSQLmethod
On 10/11/00 10:52 am, "Phil Harris" [EMAIL PROTECTED] wrote: tone, How about (untested): where 'dboptions' is the string pulled from the DB, and 'options' is the list needed. dtml-call "REQUEST.set('options',[])" dtml-in "_.string.split(dboptions[1:-1],',')" dtml-call "options.append(_.int(_['sequence-item']))" /dtml-in This would then give you take the string "['1','2','3']" and turn it into the list [1,2,3]. hth Phil Aha! That's just about what I'd come up with before. Ok, well to be honest I actually got as far as the string.split and ended up using a _.string.find() construct to get a pseudo-lookup working :) I suppose to make it more generic, you'd lose the _.int() part. Thanks for the info Phil. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: DateTime
These aren't really hosting related so I'm moving this to the [EMAIL PROTECTED] list... Thiebaut CHAMPENIER wrote: The official home page for this module is http://starship.python.net/~lemburg/mxDateTime.html (not responding rigth now) IIRC, starship is down 'cos the Python team are moving to DC. mxDateTime is _not_ the DateTime in Zope. If only it was BTW, DateTime is a Python module, it is not specific to Zope. Unless I'm mistaken, the one in Zope is specific to Zope ;-) The solution will look something like that: dtml-var expr="_.DateTime(date_posted)" You may want soem fmt= in there, check the Zope Quick Reference... cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] RE: Zope digest, Vol 1 #1049 - 28 msgs
Hi all I am strugging with accessing acl_users from DTML, and maybe someone here can tell me what I'm doing wrong. I am trying to make a page where users can change their own passwords. I have a DTML document with "Manager" proxy role. It is a form that lets the user enter "password" and "confirm" and contains a hidden field for "name" taken from AUTHENTICATED_USER. It has a submit button with value "Change", and in all respects, as far as I can tell, should post in the same way as the corresponding form in acl_users.manage_users?submit=edit It posts to itself, where I do this: dtml-if "REQUEST_METHOD=='POST'" dtml-call "REQUEST.set('roles',AUTHENTICATED_USER.getRoles())" dtml-var "acl_users.manage_users(REQUEST=REQUEST)" /dtml-if I don't get errors, but the password is not changed, and I can't see why. Has anyone ever got this sort of thing to work? And if so, how? Peter Harris This message and any files transmitted with it are confidential. The contents may not be disclosed or used by anyone other than the addressee. If you have received this communication in error, please delete the message and notify JBB (Greater Europe) Plc immediately on 0141-249-6285. The views expressed in this email are not necessarily the views of JBB (Greater Europe) PLC. As it has been transmitted over a public network, JBB (Greater Europe) PLC makes no representation nor accepts any liability for the email's accuracy or completeness unless expressly stated to the contrary. Should you, as the intended recipient, suspect that the message has been intercepted or amended, please notify JBB (Greater Europe) Plc immediately on 0141-249-6285. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: DateTime
On Fri, 10 Nov 2000, Chris Withers wrote: mxDateTime is _not_ the DateTime in Zope. If only it was It's voting season, so I vote +10 for this one. bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Fac de Medecine de Nicehttp://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is data.fs corrupted?
Chris McDonough wrote: I'm going to take a guess. It would appear AFAICT that the ZDiscussions product installed an object which it hung off the root object (the application object) when it was first imported. Don't rememebr seeing anything like this in ZDiscussions when I was looking over the code... The point being that I'd bet we'd find a programming error staring at us in this sequence of events if we looked hard enough. Though it's tempting to call it a "ZODB corruption" problem, if you really get down to the lower levels, it's likely an application-level problem. Maybe it's a Zope-level rather than ZODB level problem? Maybe some of the ZClass machinery or product registration machinery is screwing things up? Given that people have reported this from more than one product now, I'd be inclined to think it's not random bits of bad code in products. Maybe there's a method/pattern which used to be okay/recommended which is now causing problems? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZCatalog and random key error
You will still see random key errors until Chris Petrilli puts his ZCatalog fixes into the 2.2 branch (hopefully 2.2.3). - Original Message - From: "Bak @ kedai" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 09, 2000 11:56 PM Subject: [Zope] ZCatalog and random key error hello all i'm about to venture into building a ZClass that will make use of ZCatalog. is it 'safe' now? i see that my zope2.2.2 now haven't encountered any random key error yet. what about others? also, will iterating through catalog index faster than iterating through ..say.. objectItems('meta-type')? looking for insight, advice, holes to avoid, etc thanks -- http://www.kedai.com.my/kk http://www.kedai.com.my/eZine use Zope? then you got HOPE! ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is data.fs corrupted?
Maybe it's a Zope-level rather than ZODB level problem? Maybe some of the ZClass machinery or product registration machinery is screwing things up? This is possible. Maybe even likely. Given that people have reported this from more than one product now, I'd be inclined to think it's not random bits of bad code in products. Maybe there's a method/pattern which used to be okay/recommended which is now causing problems? Some of the product registration code has been overhauled by Tres Seaver lately.. I wonder if he spotted anything that would have caused something like this. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is data.fs corrupted?
On Fri, 10 Nov 2000, Chris Withers wrote: Chris McDonough wrote: I'm going to take a guess. It would appear AFAICT that the ZDiscussions product installed an object which it hung off the root object (the application object) when it was first imported. Don't rememebr seeing anything like this in ZDiscussions when I was looking over the code... The point being that I'd bet we'd find a programming error staring at us in this sequence of events if we looked hard enough. Though it's tempting to call it a "ZODB corruption" problem, if you really get down to the lower levels, it's likely an application-level problem. Maybe it's a Zope-level rather than ZODB level problem? Maybe some of the ZClass machinery or product registration machinery is screwing things up? Given that people have reported this from more than one product now, I'd be inclined to think it's not random bits of bad code in products. Maybe there's a method/pattern which used to be okay/recommended which is now causing problems? FWIW, I can also report this problem with ZDiscussions. In my case it stemmed from not properly deleting the ZDiscussion product before moving my Data.fs from 2.1.6 to 2.2.1 (I think). The symptom then was beeing unable to create ZSQL Methods (!) because of a missing ../Products/ZDBase/ZDiscussions.py file which I "fixed" by installing ZDBase again. I can however NOT import the ZDiscussions.zexp anymore because of "Duplicate Class Ids". Oh well, Stefan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is data.fs corrupted?
FWIW, I can also report this problem with ZDiscussions. In my case it stemmed from not properly deleting the ZDiscussion product before moving my Data.fs from 2.1.6 to 2.2.1 (I think). The symptom then was beeing unable to create ZSQL Methods (!) because of a missing ../Products/ZDBase/ZDiscussions.py file which I "fixed" by installing ZDBase again Man that's weird. But it's good info. Does the current PTK include ZDiscussions? I can however NOT import the ZDiscussions.zexp anymore because of "Duplicate Class Ids". So it looks like a ZClass didn't get cleaned up properly when you deleted the ZDiscussions through-the-web product. It might mean that there's a reference to an object in that area somewhere else in the ZODB. It'd be interesting for someone (not me, I'm booked) to think about how to write a tool that could detect orphaned instances and "strange" references in the ZODB. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] XML Document DTML's tree, HiperDOM
Chris Withers wrote: Shane Hathaway wrote: Here's my guess: you have a complex XML document. As you explore the document, Zope is setting a cookie that reflects the list of branches you have opened. After opening a large number of branches, you reach the limit on the size of a cookie (somewhere in the range of 1024 or 4096 bytes), making it so that the compressed data stored in the cookie gets truncated. zlib then emits this cryptic error message. Is this dtml-tree being bad again? Assuming my diagnosis is correct, it's more of a browser thing. If so, how the session information proposal/project getting along? Oh yeah, while I'm here, how's the HiperDOM project getting on? That stuff would be raally useful for a project here... The answer to these questions and more can be found at dev.zope.org. The fishbowl keeps better track of projects than any human. Shane ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] querying status in zsql
Hi Zopers, I have a processing script that takes emails and puts them into a table. I bring up a table for confirmation and then submit the whole thing by a iterative item:records zsql method. My problem is that the table requires a unique primary key and quite regularly there duplicates. So ofcourse it falls over with the expected error. I have tried in the zsql method encapsulating the sql with a dtml-if "checkforexistantrecord" and then at the bottom of the zsql loop I commit so make sure the second time around, the data is checked. This does not seem to work. So what im left with wondering is, if I can query in the zsql method: if error, then exit or go somewhere else Is this possible? sorry to be very vague. The conundrum is the fact that the zsql method it an item loop in its own, so i cannot seem to use an if statement because it doesnt iterate by the normal dtml-in route Any advice? TIA, -- Paz Oratrix Development BV http://www.oratrix.com GRiNS SMIL Editor - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] DTML on Linux client
I checked my website www.goeldi.com with a SuSE Linux 7 client (Netscape) and discovered, that not all DTML is done right. My index_html file has: dtml-var standard_html_header Welcome to our website. dtml-var actual dtml-var standard_html_footer The header and footer are displayed correct. The welcome text of the index_html file too. But the dtml-var actual is not displayed at all. The text browser lynx has the same problem under linux. I tried it from a RedHat 6.2 system with lynx - same problem. The page is displayed correctly with any Windows browser. What's going wrong here? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is data.fs corrupted?
Chris McDonough wrote: FWIW, I can also report this problem with ZDiscussions. In my case it stemmed from not properly deleting the ZDiscussion product before moving my Data.fs from 2.1.6 to 2.2.1 (I think). The symptom then was beeing unable to create ZSQL Methods (!) because of a missing ../Products/ZDBase/ZDiscussions.py file which I "fixed" by installing ZDBase again Man that's weird. But it's good info. Does the current PTK include ZDiscussions? No Chris :-) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is data.fs corrupted?
On Fri, 10 Nov 2000, Chris McDonough wrote: FWIW, I can also report this problem with ZDiscussions. In my case it stemmed from not properly deleting the ZDiscussion product before moving my Data.fs from 2.1.6 to 2.2.1 (I think). The symptom then was beeing unable to create ZSQL Methods (!) because of a missing ../Products/ZDBase/ZDiscussions.py file which I "fixed" by installing ZDBase again Man that's weird. But it's good info. Does the current PTK include ZDiscussions? Ah yes, I also had some PTK version installed in the 2.1.6 Zope; in case this might be of importance. I can however NOT import the ZDiscussions.zexp anymore because of "Duplicate Class Ids". So it looks like a ZClass didn't get cleaned up properly when you deleted the ZDiscussions through-the-web product. It might mean that there's a reference to an object in that area somewhere else in the ZODB. I believe I *did not* delete ZDiscussions, but brought my Data.fs to 2.2.1 without having the product installed there. Operator error, I suppose ;) Funny thing is that I did not *use* any ZDiscussions, PTK or whatever objects (anymore), just had the products hang around thinking they were stale anyway... Regards, Stefan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] XML Document DTML's tree, HiperDOM
Shane Hathaway wrote: The answer to these questions and more can be found at dev.zope.org. The fishbowl keeps better track of projects than any human. The tempation to say "and the fishbowl confuses more humans than any project can keep track of" was to great ;-) It's not actually true, I guess, except for me. I went and had a look at the HiperDOM project and couldn't make heads or tails of what the status was. That put me off even looking for session tracking... wuss? me? probably... ;-) Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] XML Document DTML's tree, HiperDOM
The answer to these questions and more can be found at dev.zope.org. The fishbowl keeps better track of projects than any human. The tempation to say "and the fishbowl confuses more humans than any project can keep track of" was to great ;-) It's not actually true, I guess, except for me. I went and had a look at the HiperDOM project and couldn't make heads or tails of what the status was. That put me off even looking for session tracking... Note that the Fishbowl is still somewhat immature - the specific problem of finding out the status of things is something I'm working on (albeit slowly, unfortunately). Very Soon Now there will be some built-in support to help this. In the meantime, project leaders will need to go the extra mile to try to make it clear to readers where things stand. There is, after all, a "CurrentStatus" page dedicated to this. If the CurrentStatus is empty or clearly out of date, readers of the project should prod the project leader about that (their contact email should be in the project). Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] why DTML confusing
Hello All, I do read HOW-TO's, User-Guides, etc., but I think DTML must be made simpler, or better documentation, or more examples. As an example, within an dtml-in loop: 1. You can print the values of sequence-items with: (index=dtml-var sequence-index, number=dtml-var sequence-number, item=dtml-var sequence-item) 2. To test for equality, this does not: dtml-if "sequence-index == 0" (dtml-var count-adassnum Records found) /dtml-if 3. While this does work: dtml-if "_['sequence-index'] == 0" (dtml-var count-adassnum Records found) /dtml-if I say this is confusing. Don't tell me to read the Namespace How-to, or the Zope User Guides, I did, and it's still confusing! Unless you find an example, that does exactly what you want, trying to figure it out with the documentation available can be difficult. I found my answer to this in the "How-To: (How-to) access the field names and fields of any arbitrary ZSQL query", but it took a lot of searching the Zope site for references to 'dtml-in'. I get so frustrated with DTML, I want to scream. Please don't tell me to buy the Zope book, DTML should be more intuitive. DTML maybe the heart of Zope, but it's also it's achilles heel. -- irene -- Irene Barg Email: [EMAIL PROTECTED] Steward Observatory Phone: 520-621-2602 933 N. Cherry Ave. University of Arizona FAX:520-621-1891 Tucson, AZ 85721 http://nickel.as.arizona.edu/~barg -- ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML on Linux client
My take is that it's a client issue. Since you explicity mention that your using a Linux client, I'd assume you've tried a windows client? If so was it Ie/Netscape/Opera etc. IE and Netscape in particular play by their own rules and render things differently. Maybe your html is causing one of those differences to manifest itself. When 'actual' doesn't appear in the browser window, can you check the source for the page, and is the content there in the html? It doesn't seem to be a Zope problem to me. Phil - Original Message - From: "Stephan Goeldi" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 10, 2000 2:31 PM Subject: [Zope] DTML on Linux client I checked my website www.goeldi.com with a SuSE Linux 7 client (Netscape) and discovered, that not all DTML is done right. My index_html file has: dtml-var standard_html_header Welcome to our website. dtml-var actual dtml-var standard_html_footer The header and footer are displayed correct. The welcome text of the index_html file too. But the dtml-var actual is not displayed at all. The text browser lynx has the same problem under linux. I tried it from a RedHat 6.2 system with lynx - same problem. The page is displayed correctly with any Windows browser. What's going wrong here? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Generating text/csv from DTML method, Mime Type?
I'm create a CSV file that I would like browsers to get the "save as" dialog when they select it. I'm using RESPONSE.write() to write out the CSV file, and I set the Content-Type before calling RESPONSE.write Netscape seems to work ok, it pops up a save box for "text/csv" and "application/vnd.ms-excel". However in both cases IE5.5 just ignores the data and re-requests the page. Does anyone know *all* the steps I need to take to get this to work correctly with IE? I must be doing something wrong. I want to supply a CSV file, but generated dynamically. I'm sure I'm missing a header setting or something. Brad Clements,[EMAIL PROTECTED] (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] XML-RPC
Hi Jason, I've been working with Flash some lately as well.. with an eye toward useful vector graphics for Zope. There is a library called ming (http://www.opaque.net/ming) with a (SWIG'ed) python extension that I've been slowing working through, adding wrapping fuctions and getting to the point of Zope'ability. Ming is a 'swf' creation library with no connection to Macromedia. Something like this would free folks from the need to buy 'MM Flash' to work with swf output. It also would make a great way to generate swf 'on the fly' within Zope.. I'll try to get a proof of concept working -steve "Jason" == Jason Cunliffe [EMAIL PROTECTED] writes: Jason Hello Jason I am missing the start of this thread, so I may be off Jason topic, but you might want to look seriously at Flash5 for Jason the client side programming and graphics. Jason PROS: Jason 1. Flash5 ActionScript is _very_ close to JavaScript Jason 2. Flash Player/Plugin is much smaller than SVG 300Kb Jason vs. 13Mb I think + large user installed base. Jason 3. Flash5 has new XML and XMLSockets objects which should Jason integrate nicely with XMLRPC and Zope via some smooth Jason Python external method programming. Jason 4. Flash will allow _much_ more client side interactivity Jason than SVG Jason 5. You can port SVG graphics to Flash using various tools Jason [or even write your own]. Jason 6. You can still use SVG JavaScript and do some comparisons Jason where appropriate... Jason 7. Flash is more mature than SVG, though I agree SVG is Jason developing very well. I expect we shall see some serious Jason applications during next 12 months with it. Jason 8. Flash is very object-oriented once you grok to its Jason design. Thus mirrors Zope very well. Jason CONS: Jason A. Flash has steepish learning curve, but high payback and Jason reusability. [Not as tough as Zope :-) ] B. SVG is fully Jason open; the Flash spec is 'published' but not open in the Jason same way. C. must be more but cant thing of them right now Jason If you are interested contact me - I have lots of useful Jason research on this topic. Jason - Jason Jason ___ Jason Jason Cunliffe = Nomadics['Interactive Art+Technology'] - Original Message - From: "Hannu Krosing" [EMAIL PROTECTED] To: "David Nimmons" [EMAIL PROTECTED] | David Nimmons wrote: | | I am trying to develop a web based interface to automation equipment (Allen | Bradley plc's in this case) to use for an operator interface. I am Jason using | SVG to develop graphics and want to use javascript to manipulate the | graphics based on data from the plc. I am looking for a way to pull Jason more | data from the server without having to reload the page. My question is will | XML-RPC allow this. Or does Zope have some other mechanism that would allow | this. Thanks for any help. | | Actually this is mainly a client-side problem, on server side you have | total | freedom to serve any protocol ;) | | Often this kind of problem is solved by having twho frames and data is | aquired | by reloading the "data-page" which then manipulates the | "presentation-page" | using javascript, possibly in its onLoad method. Jason ___ Zope Jason maillist - [EMAIL PROTECTED] Jason http://lists.zope.org/mailman/listinfo/zope ** No cross Jason posts or HTML encoding! ** (Related lists - Jason http://lists.zope.org/mailman/listinfo/zope-announce Jason http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML on Linux client
Sorry, in fact this was a 'cache-problem'. I always have to hit the 'reload' button to get the right content. In Windows the old content was shown, in Linux the actual (because I did not browse before on this page). In the management screens too I always must hit reload after a change of the content. I checked my website www.goeldi.com with a SuSE Linux 7 client (Netscape) and discovered, that not all DTML is done right. _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] DataSkin Supplier?
Hello... Okay, I'm still staring up at the ZPatterns learning cliff as I write this so forgive my ignorance. I'm looking at ZPatterns WRT to 'dynamically generated dataskins'. You what? Well, okay, I'll try and explain... Firstly, I'm assuming that DataSkins (or their subclasses?) are first-class zope objects, can be 'added', copied, pasted, have security tabs, can be catalogued, URL traversed, etc, etc. Is that assumption correct? I hope so :-S If it is, is there something which can generate DataSkins on the fly? ie: in the same way an AttributeProvider supplier attributes to an object, is there something like a 'DataSkin provider' which provides whole dataskins to a folderish object? Finally, and this is the important bit. Can one of these folderish objects also _be_ a DataSkin? So, to word it differently, there is a root 'DataSkin provider'. This provides DataSkins which are folderish and are also 'DataSkin providers' themselves. Why do I want this? Well, think objects in a tree where the parents/children are stored as a list of names refering to other objects. In addition, objects may have multiple parents, etc... Any ideas? Where should I start reading? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Generating text/csv from DTML method, Mime Type?
I'm create a CSV file that I would like browsers to get the "save as" dialog when they select it. I'm using RESPONSE.write() to write out the CSV file, and I set the Content-Type before calling RESPONSE.write Netscape seems to work ok, it pops up a save box for "text/csv" and "application/vnd.ms-excel". However in both cases IE5.5 just ignores the data and re-requests the page. Does anyone know *all* the steps I need to take to get this to work correctly with IE? I must be doing something wrong. I want to supply a CSV file, but generated dynamically. I'm sure I'm missing a header setting or something. Adding "Content-Disposition: attachment [; filename=bla.csv]" as a http-header might help... The part in []s is optional . See my mail from yesterday for a bit more info cheers, oliver ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] querying status in zsql
I have a processing script that takes emails and puts them into a table. I bring up a table for confirmation and then submit the whole thing by a iterative item:records zsql method. My problem is that the table requires a unique primary key and quite regularly there duplicates. So ofcourse it falls over with the expected error. I have tried in the zsql method encapsulating the sql with a dtml-if "checkforexistantrecord" and then at the bottom of the zsql loop I commit so make sure the second time around, the data is checked. This does not seem to work. So what im left with wondering is, if I can query in the zsql method: if error, then exit or go somewhere else Is this possible? yes, this is possible. If I understand your question at least. BTW This is untested, but I have used something similar before mailid is the input field/variable for your method dtml-in emailitems dtml-in checkexistant_error(mailid=mailid) (if this is another zsql method) dtml-if sequence-start skip or do something else dtml-else upload your email. You may want to call another Zsql method for this /dtml-if /dtml-in dtml-in sorry to be very vague. The conundrum is the fact that the zsql method it an item loop in its own, so i cannot seem to use an if statement because it doesnt iterate by the normal dtml-in route Any advice? hth Rik ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Is data.fs corrupted?
Thanks for the informative thread. FWIW, I see this problem too. It's preventing me from importing various PTK Membership .zexp's. -Simon ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
It's a give-and-take I think. I had the same confusion as you have right now, but after a while you learn this syntax pretty well. This is the same as with all syntax, and as soon as you have learned the basics the rest is easy and from then on a matter of learning how to use extensive functions and methods. I found DTML confusing as well in the begining, but I know feel that DTML is not bad at all. The DTML syntax is sometimes even more convenient than - otherwise known to be simple - PHP syntax. If you read the Zope Book by Michael and Amos you'll be told to use Python Methods for almost all functionality and leave DTML as a very basic tool for your content visualization. Don't give up Irene! This is just part of the steep (almost exponential) Zope learning curve. Greetings, peter I say this is confusing. Don't tell me to read the Namespace How-to, or the Zope User Guides, I did, and it's still confusing! Unless you find an example, that does exactly what you want, trying to figure it out with the documentation available can be difficult. I found my answer to this in the "How-To: (How-to) access the field names and fields of any arbitrary ZSQL query", but it took a lot of searching the Zope site for references to 'dtml-in'. I get so frustrated with DTML, I want to scream. Please don't tell me to buy the Zope book, DTML should be more intuitive. DTML maybe the heart of Zope, but it's also it's achilles heel. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
Irene Barg [EMAIL PROTECTED] writes: 1. You can print the values of sequence-items with: (index=dtml-var sequence-index, number=dtml-var sequence-number, item=dtml-var sequence-item) 2. To test for equality, this does not: dtml-if "sequence-index == 0" (dtml-var count-adassnum Records found) /dtml-if 3. While this does work: dtml-if "_['sequence-index'] == 0" (dtml-var count-adassnum Records found) /dtml-if I say this is confusing. Don't tell me to read the Namespace How-to, or the Zope User Guides, I did, and it's still confusing! Unless you find an example, that does exactly what you want, trying to figure it out with the documentation available can be difficult. I found my answer to this in the "How-To: (How-to) access the field names and fields of any arbitrary ZSQL query", but it took a lot of searching the Zope site for references to 'dtml-in'. I get so frustrated with DTML, I want to scream. Please don't tell me to buy the Zope book, DTML should be more intuitive. DTML maybe the heart of Zope, but it's also it's achilles heel. -- irene -- Irene BargEmail: [EMAIL PROTECTED] Steward Observatory Phone: 520-621-2602 933 N. Cherry Ave. University of Arizona FAX:520-621-1891 Tucson, AZ 85721 http://nickel.as.arizona.edu/~barg -- ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
* peter bengtson ([EMAIL PROTECTED]) [001110 10:40]: It's a give-and-take I think. I had the same confusion as you have right now, but after a while you learn this syntax pretty well. This is the same as with all syntax, and as soon as you have learned the basics the rest is easy and from then on a matter of learning how to use extensive functions and methods. Considering that DTML is supossed to be for web/html writers, *not* for programmers, I think that's not a good attitude to take. I don't want web-writers having to figure out that to access a variable, *that was being use a second ago with no extra syntax* suddenly needs _[''] wrapped around it. It doesn't make any sense UNLESS you know what's going on underneith. And since the whole attitude for Zope is, "do it right". I'd say this needs to be addressed at some point. Ciao! -- Although the moon is smaller than the earth, it is farther away. The Doctor What: A really hip dude http://docwhat.gerf.org/ [EMAIL PROTECTED] KF6VNC ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] querying status in zsql
Thanks for that... Although Im not terribly sure what the magic behind the sequence-start is, but it works very well. Cheers, -- Paz Oratrix Development BV http://www.oratrix.com GRiNS SMIL Editor - Rik Hoekstra wrote: I have a processing script that takes emails and puts them into a table. I bring up a table for confirmation and then submit the whole thing by a iterative item:records zsql method. My problem is that the table requires a unique primary key and quite regularly there duplicates. So ofcourse it falls over with the expected error. I have tried in the zsql method encapsulating the sql with a dtml-if "checkforexistantrecord" and then at the bottom of the zsql loop I commit so make sure the second time around, the data is checked. This does not seem to work. So what im left with wondering is, if I can query in the zsql method: if error, then exit or go somewhere else Is this possible? yes, this is possible. If I understand your question at least. BTW This is untested, but I have used something similar before mailid is the input field/variable for your method dtml-in emailitems dtml-in checkexistant_error(mailid=mailid) (if this is another zsql method) dtml-if sequence-start skip or do something else dtml-else upload your email. You may want to call another Zsql method for this /dtml-if /dtml-in dtml-in sorry to be very vague. The conundrum is the fact that the zsql method it an item loop in its own, so i cannot seem to use an if statement because it doesnt iterate by the normal dtml-in route Any advice? hth Rik ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] why DTML confusing
It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. Agreed. But DC always raises objections when this is brought up. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Dr.Watson on NT
Hi all, Is there a NT guru in the house :-) Zope 222 Sometimes Zserver goes Zombie, I login on the machine and I see a DrWatson Window. I close DrWatson window and the process automagically restarts, and everything ok. Whenever this happens two logs are written in EventLogger: -one is a Warning: Restarting Zope... -one is a Info: starting Zope... With a couple of seconds of distance in time between them. I can see something is puting ZServer zombie and I'm looking at debug to find the sucker method :-) but this DrWatson behaviour never seen by me before: could be Zope doing a Zombie Timeout and restarting himself? If yes why does he hangs and only by closing the DrWatson Window the python.exe process really restarts? Any comments, tips, Dr.Watson Guru? Best Regards, Júlio Dinis Silva _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZClass
From inside what object should I inherit from to get a history option for a zclass or what method would I need to write. I have looked at lots of examples of zclasses and so far none of them have a history tab. I am working with the STX_Document type and made a new zclass based on that which includes renderable and catalogaware as base classes. Those were the instructions on the STX document page but that still did not give me the option for a history tab but it did fix other things that I needed. Thanks Kosh ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Generating text/csv from DTML method, Mime Type?
I know this sounds silly, but try making the url end with .csv I wrote a perl cgi script some time ago that spit out a csv file. When it ended with .csv, IE seemed to ignore the server's Content-type: text/html header. http://finance.yahoo.com/q?s=WCGd=v1 Look, my stock is falling! Actually, if you look at the link below and to the right of the table, you'll see a download spreadsheet link. Yahoo uses a e=.csv to set the extension. Presumably, the e value is for extension. Troy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, November 10, 2000 11:15 AM To: [EMAIL PROTECTED] Subject: Re: [Zope] Generating text/csv from DTML method, Mime Type? "Brad Clements" [EMAIL PROTECTED] writes: I'm create a CSV file that I would like browsers to get the "save as" dialog when they select it. I'm using RESPONSE.write() to write out the CSV file, and I set the Content-Type before calling RESPONSE.write Netscape seems to work ok, it pops up a save box for "text/csv" and "application/vnd.ms-excel". However in both cases IE5.5 just ignores the data and re-requests the page. Does anyone know *all* the steps I need to take to get this to work correctly with IE? I must be doing something wrong. I want to supply a CSV file, but generated dynamically. I'm sure I'm missing a header setting or something. FWIW, I recently had to support a customer in downloading files for use by spreadsheet software. After a little investigating, especially at the IETF web/FTP site, I discovered that there is no registered MIME type "text/csv". Can anyone refute this? There is a registered MIME type "text/tab-separated-values". Based on something I read recently on the Zope site, it may be that if you set the MIME type to application/vnd.ms-excel but send a tab separated values file, excel will open it. I haven't tried this though. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. I agree, changing the "-" to "_" would remove a whole ton of posts on this list and mean I could chop a whole bunch of dtml-let item=sequence-item. I really only see negative reasons for a "-". -- Andy McKay, Developer. ActiveState. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] restarting zope.org
we'll be back after these messages. ~ethan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Can Zope use a Different Python?
Hi. We've got Zope 2.2.2 installed on a Linux box. We want to be able to use the full-up python that's on the box instead of the python interpreter that comes with Zope for playing with External Methods. Is there any way to circumvent Zope's python in this way? If not, what's the easiest way to extend Zope to be able to use our non-Zope python? Alternatively, we're plagued by import and attribute errors when accessing the External Methods. Will simply moving (or linking?) all the pieces (whatever.py, __init__.py, etc.) into a subdirectory of "Shared" fix the problem? Thanks in advance for your help. -GMP ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Generating text/csv from DTML method, Mime Type?
I know this sounds silly, but try making the url end with .csv I wrote a perl cgi script some time ago that spit out a csv file. When it ended with .csv, IE seemed to ignore the server's Content-type: text/html header. http://finance.yahoo.com/q?s=WCGd=v1 Look, my stock is falling! Actually, if you look at the link below and to the right of the table, you'll see a download spreadsheet link. Yahoo uses a e=.csv to set the extension. Presumably, the e value is for extension. That isn't silly, it corresponds exactly with the description you can find at http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.asp There term silly seems much more suitable for that, btw. Btw., it shows that changing the extension to .csv won't help until one has registered an application for .csv-files in windows. And in fact, the "spreadsheet"-link showed up in my IE, no download window came up... cheers, oliver ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] why DTML confusing
From: Andy McKay It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. I agree, changing the "-" to "_" would remove a whole ton of posts on this list and mean I could chop a whole bunch of dtml-let item=sequence-item. I really only see negative reasons for a "-". For once I will send a "me too" to the list. "sequence-item" is a simple and plain design error. Decapricate it and and let us use "sequence_item" etc. together with the other for a while and then drop the old form. It is the single most annoying thing in dtml, and as far as I can see in the source it should be trivial to give all those sequence-* a sequence_* name also. Regards Max M Max M. W. Rasmussen,Denmark. New Media Director private: [EMAIL PROTECTED] work: [EMAIL PROTECTED] - Specialization is for insects. - Robert A. Heinlein ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] bad expression evaluation
I'm trying to compare two page titles, using this code: dtml-call "REQUEST.set('my_title',get_page_title)" dtml-in "PARENTS[1].objectValues(['Folder'])" dtml-my_title; : dtml-get_page_title dtml-if "my_title!=get_page_title" dtml-var title_or_id /dtml-if /dtml-in Now I can see on the page that my_title and get_page_title are the same. I have also tried comparing _.str(my_title) and _.str(get_page_title) just to make sure I was comparing strings. But the if clause always evaluates true. Any ideas? cheers, seb. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Generating text/csv from DTML method, Mime Type?
On Fri, 10 Nov 2000, Farrell, Troy wrote: I know this sounds silly, but try making the url end with .csv I wrote a perl cgi script some time ago that spit out a csv file. When it ended with .csv, IE seemed to ignore the server's Content-type: text/html header. Not silly! I have also seen IE prefer the file extension over any MIME type, HTTP header or whatever interoperable standard you may come up with. Welcome to the Micro$oft way of making the Internet an extension of its desktop... ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Can Zope use a Different Python?
On Fri, 10 Nov 2000, Gary Perez wrote: We've got Zope 2.2.2 installed on a Linux box. We want to be able to use the full-up python that's on the box instead of the python interpreter that comes with Zope for playing with External Methods. Is there any way to circumvent Zope's python in this way? get the source distribution Alternatively, we're plagued by import and attribute errors when accessing the External Methods. Will simply moving (or linking?) all the pieces (whatever.py, __init__.py, etc.) into a subdirectory of "Shared" fix the problem? check your PYTHONPATH in the start script hth, stefan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Generating text/csv from DTML method, Mime Type?
I telneted into the link I gave below and here is the RESPONSE: HTTP/1.0 200 OK Date: Fri, 10 Nov 2000 19:26:52 GMT Cache-Control: private Connection: close Content-Type: application/octet-stream Set-Cookie: B=48be9l0t0oivtb=2; expires=Thu, 15 Apr 2010 20:00:00 GMT; path=/; domain=.yahoo.com "WCG",15.625,"11/10/2000","1:57PM",-1.8125,17.375,17.375,15.625,671100 So you can see that they are using the MIME type of application/octet-stream. They also set a cookie. I hate cookies. Troy -Original Message- From: Oliver Bleutgen [mailto:[EMAIL PROTECTED]] Sent: Friday, November 10, 2000 12:37 PM To: [EMAIL PROTECTED] Subject: RE: [Zope] Generating text/csv from DTML method, Mime Type? I know this sounds silly, but try making the url end with .csv I wrote a perl cgi script some time ago that spit out a csv file. When it ended with .csv, IE seemed to ignore the server's Content-type: text/html header. http://finance.yahoo.com/q?s=WCGd=v1 Look, my stock is falling! Actually, if you look at the link below and to the right of the table, you'll see a download spreadsheet link. Yahoo uses a e=.csv to set the extension. Presumably, the e value is for extension. That isn't silly, it corresponds exactly with the description you can find at http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.as p There term silly seems much more suitable for that, btw. Btw., it shows that changing the extension to .csv won't help until one has registered an application for .csv-files in windows. And in fact, the "spreadsheet"-link showed up in my IE, no download window came up... cheers, oliver ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Generating text/csv from DTML method, Mime Type?
Here's some DTML I use to generate a CSV file on the fly using data returned from a query of a MySQL database: dtml-call "RESPONSE.setHeader('Content-Type', 'application/x-csv')"dtml-in qryAllDB dtml-if sequence-start FirstName,MiddleName,LastName,Address,City,State,Zip,Phone,Fax,Email,URL,Bir thday /dtml-if sequence-start dtml-var FirstName null='',dtml-var MiddleName null='',dtml-var LastName null='',dtml-var Address null='',dtml-var City null='',dtml-var State null='',dtml-var Zip null='',dtml-var Phone null='',dtml-var Fax null='',dtml-var email null='',dtml-var URL null='',dtml-var Birthday null='' /dtml-in Notice that formatting is kinda ugly. That's so that I don't get any unwanted carriage returns nor any line feeds in the downloaded file. Also, notice that the first line of the output (after the Content-Type, that is) is a header line, which you may not want for your output. I include it so that when the file is viewed in a spreadsheet, the user can tell what each column is. FYI, I found a lot of info on this technique on NIP Ltd's mailing list archive (Thanks again NIP!!): http://zope.nipltd.com/public/lists.html HTH, Eric. // -Original Message- // From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of // Oliver Bleutgen // Sent: Friday, November 10, 2000 8:12 AM // To: [EMAIL PROTECTED] // Subject: Re: [Zope] Generating text/csv from DTML method, Mime Type? // // // I'm create a CSV file that I would like browsers to get the "save as" // dialog when they select it. // // I'm using RESPONSE.write() to write out the CSV file, and I set the // Content-Type before calling RESPONSE.write // // // Netscape seems to work ok, it pops up a save box for "text/csv" and // "application/vnd.ms-excel". // // However in both cases IE5.5 just ignores the data and re-requests the // page. // // Does anyone know *all* the steps I need to take to get this to work // correctly with IE? I must be doing something wrong. I want to supply a // CSV file, but generated dynamically. I'm sure I'm missing a header // setting or something. // Adding "Content-Disposition: attachment [; filename=bla.csv]" as // a http-header might help... // The part in []s is optional . // See my mail from yesterday for a bit more info // // cheers, // oliver // // ___ // Zope maillist - [EMAIL PROTECTED] // http://lists.zope.org/mailman/listinfo/zope // ** No cross posts or HTML encoding! ** // (Related lists - // http://lists.zope.org/mailman/listinfo/zope-announce // http://lists.zope.org/mailman/listinfo/zope-dev ) // ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
[Max M.] | For once I will send a "me too" to the list. "sequence-item" is a simple and | plain design error. Decapricate it and and let us use "sequence_item" etc. | together with the other for a while and then drop the old form. I'd like to join this mob. ;) It's painful and ugly to use "_['sequence-item']", "_['sequence-index']" etc... -Morten ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] bookmark importer
Hello guys I' have here a pyton file that allows you to import your bookmarks from IE. The following prob is that it works on windows98 zope 2.2.2 and not on a unix system. The file temp.txt stays empty and you get the message 'unable to export favourites' anyone any idea? def GetBookmark(self): import string if self.REQUEST['HTTP_USER_AGENT']=='PostFavorites': print self.REQUEST.cookies file = self.REQUEST.stdin if file: file.seek(0) LBook=[] while 1: line = file.readline() if not line: break LBook.append(line) RBookmarkList=RList(LBook[RFirst(LBook):len(LBook)]) print RBookmarkList ftemp = open('temp.txt','w') ftemp.write(RBookmarkList) ftemp.close() return 'RBookmarkList' else: s='A HREF=''javascript:window.external.ImportExportFavorites(false,' s=s+'"http://aegis:8080/Bookmarker");' s=s+'window.location.reload();Click me.../AP' ftemp = open('temp.txt','r') if ftemp: l=ftemp.readline() ftemp.close() ftemp = open('temp.txt','w') ftemp.close() if l: s=s+l return s def RFirst(l): import string for i in range(len(l)): if (string.find(l[i],"DL")-1): return i return None def RLast(l): import string k=0 for i in range(len(l)): if string.find(l[i],"DL")-1: k=k+1 if string.find(l[i],"/DL")-1: k=k-1 if k==0: return i def RList(LD): import string Dict='' LDict='' iLast=0 for i in range(len(LD)): if i=iLast : l=LD[i] if (string.find(l,"DTA HREF")-1): s=l[string.find(l,"A HREF")+9:len(l)] s0=s[0:string.find(s,'"')] s=s[string.find(s,"")+1:len(s)] s=s[0:string.find(s,"")] Dict='{title:"'+s+'", url:"'+s0+'"}' if LDict=="": LDict=Dict else: LDict=LDict+','+Dict if (string.find(l,"DT")-1) and (string.find(l,"A HREF")==-1): s=l[string.find(l,"DT")+4:len(l)] s=s[string.find(s,"")+1:len(s)] s=s[0:string.find(s,"")] iFirst=i+1 iLast=RLast(LD[iFirst:len(LD)])+iFirst LDNew=RList(LD[iFirst:iLast]) Dict='{'+s+':['+LDNew+']}' if LDict=="": LDict=Dict else: LDict=LDict+','+Dict return LDict TIA Rishi ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
First Simon, thanks for your message. Yours is one of the most articulate explanations I've seen on this topic. Simon Michael [EMAIL PROTECTED] writes: Irene Barg [EMAIL PROTECTED] writes: [examples of DMTL confusion...] It is confusing. There are two systems of syntax in use here - DTML's and python's. Once you start using "" expressions, you have left DTML and you are in the python world. ...or "the python world with some Zope limitations placed on it." There's a third world of course, HTML. Most of us probably have that down solid, so we tend not to think of it in the context of "skills needed to master Zope." But whether it's wrapping data in an HTML table, or how to create dynamic CGI forms, mastering the integration of HTML and DTML is a critical skill that some apparently find difficult. (I've seen HOWTO's for it...) - unfortunate reality #1: you have to use "" expressions to do any kind of comparison, so you are pretty much forced into dealing with these two worlds right from the beginning. That's fine, but in the interests of good will and sanity, Zope should probably have a big fat warning label saying "DO NOT VENTURE HERE IF YOU DO NOT ALREADY KNOW, OR PLAN TO LEARN PYTHON." I did know Zope was written in Python. I did not expect that I would have to learn it. Maybe that was stupid on my part, but that's what I thought. Still, entering the python world would normally be a good thing, since syntax there is simple and consistent. But, - unfortunate reality #2: certain legacy zope variables contain "-" in their name. In the python world, this is illegal (or rather it means something different) and so you are forced to remember constructs like _['sequence-index'] all the time. It might be that fixing one or both of the above would reduce the DTML pain factor quite a bit. Certainly, it's time to do whatever it takes to banish these "-"-named variables, IMHO. Yes, it would help a lot. _[] is about as non-intuitive as you can get, especially after mixing in all the single and double quotes. Sure, if you understand python and how DTML wraps around it, it all makes sense, but that's a pretty narrow market and DMTL simply doesn't need to be that obfuscated. If the intended market is simply "people who grok Python", then there's really no point in something as Point n' Click n' GUI as Zope is. I certainly don't have all the answers, but it seems a simple matter to allow both sequence-index *and* sequence_index - i.e., create underscore equivalents alongside all the legacy "hyphen" variables. If I recall, I've even seen some user-contributed patches on this list to do just that. That's just one example of something in Zope that's "too difficult" screaming for change. But one of the practical advantages of making that kind of change is that the people who contribute their valuable time to help the newbies (and not-so-newbies) on this list won't spend quite so much time saying Try this: dtml-in "AUTHENTICATED_USER.getRoles()" dtml-if "_['sequence-item'] == 'Admin'" dtml-call "REQUEST.set('edit_ok','y')" /dtml-if /dtml-in That's an awful lot of weird syntax glue just to walk a list and set a value based on values in the list. If someone asked how to do that on a Perl mailing list, they'd be RTFM'ed and run out of town. Maybe that's not an entirely fair comparison, but still, how much of that syntax nightmare might be avoidable? I really don't know enough to say. Obviously *everything* has to be wrapped in something that at least distinguishes DTML from HTML. How quickly or deeply (or just *how*) one should get into python after that is another matter. Zope reminds me of NT in some ways (except that I *like* Zope). Zope, like NT, presents this illusion of friendly, easy learning curve, straight-forward "get the job done and move on" philosophy. At least that was my first impression. Then reality struck and I'm still recovering! What keeps me working with Zope is not so much what Zope is, but the promise of what it can be. (And the hope that when I'm finally a Python ace and understand the Zope source code from nose to tail, I'll be ready to work in DTML ;-) -cw- -- ~ Charlie Wilkinson - [EMAIL PROTECTED] - N3HAZ Parental Unit, UNIX Admin, Homebrewer, Cat Lover, Spam Fighter, HAM, SWLer... Visit the Radio For Peace International Website: http://www.rfpi.org/ ~ CLOBBER INTERNET SPAM: See!! http://spam.abuse.net/ Join!! http://www.cauce.org/ ~ QOTD: "Bush is a big corporation disguised as a human being running for president." -- Ralph Nader on David Letterman (9/28/00)
Re: [Zope] ZClasses inheriting property(sheets) : yes/no?
Hi, Aaron Yes. If your parent ZClass is constructed properly, you should be able to add the parent class's management tabs by setting a "view". On the "Views" tab, look in the Method list for propertysheets/[ParentClassPropertySheetName]/manage. The properties on that sheet are accessible just like any of the child class's properties. -- Jim Washington Aaron Straup Cope wrote: Hi, If I create a ZClass that inherits another ZClass, do I also inherit the latter's properties/propertysheet? From what I've read so far, I thought the answer was yes but I can't seem to figure out how to *get* at them. I created a ZClass called "Foo" that inherits a ZClass named "Meta". Meta had two properties : author and title but neither appear to be set when I create a new Foo object. I banged out something in plain-old Python (see below) since I was pretty sure this was the kind of thing Python was so good for (I am normally a Perl weeniesh :-) and everything worked fine. I've been looking around the docs and the how-to's but nothing seems to discuss the idea of inheriting properties (?) across ZClasses. Is it possible? Thanks, class Meta: def __init__(self,title,author,timestamp,keywords,body,public,display): self.title = title self.author= author self.timestamp = timestamp self.keywords = keywords self.body = body self.display = display self.public= public from Meta import Meta class Library(Meta): def __init__(self,title,author,timestamp,keywords,body,public,display,foo,bar=""): Meta.__init__(self,title,author,timestamp,keywords,body,public,display) self.foo = foo self.bar = bar from Meta import Meta class LibraryClass(Meta): def __init__(self,title,author,timestamp,keywords,body,public,display): Meta.__init__(self,title,author,timestamp,keywords,body,public,display) *** # from yadda yadda import ... lib = Library("budwork","bud","now",["foo","bar"],"bobdy",1,0,"foopybird") libclass = LibraryClass("classwork","bud","now",["foo","bar"],"bobdy",1,0) print "Class Title is " + lib.title print "LibClass Title is " + libclass.title ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) -- Jim Washington Center for Assessment, Evaluation and Educational Programming Department of Teaching and Learning, Virginia Tech ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] why DTML confusing
Irene says: I get so frustrated with DTML, I want to scream. Please don't tell me to buy the Zope book, DTML should be more intuitive. DTML maybe the heart of Zope, but it's also it's achilles heel. You're right about the confusion, frustration, nor are you alone. Still, DTML isn't the heart of Zope, it's more like the fascia. DTML was intended to make the task of delivering dynamic content wrapped up in HTML-ish Templates easier. It evolved, and took on a broader scope that made it enticing for lot's of "other stuff". Like most evolution, there are obvious benefits, and some unfavorable outcomes. The most glaring problems show up when you start trying to do things that seem to be just a step or two more sophisticated than simple examples that "just work". There's good news. Python Methods, or whatever we end up calling them, make actually implementing such things as easy as Py(thon). For some folks, it may look like the bad news is, "Now I have to learn Python". In perspective, learning Python is way better than wading through the Zope API via DTML. Way way better. So, the moral is, keep the DTML as simple as it can be. For anything else, reach for another tool. Zope has bunches of them. BTW, the dtml-if "_['sequence-item'}" stuff is the tip of the DTML Complexity Iceberg. The sooner you get comfortable with Python Methods, ZClasses, etc., the happier you'll be. One last point. Python Methods (a.k.a. Restricted, Internal, or some other as yet unheard of alternative, which we are all anxiously awaiting) is an add-on at this point. Target date for inclusion as part of the standard "Core Zope" is Zope v.2.3. For now, see: http://www.zope.org/Members/4am/PythonMethod Later, Jerry S. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Status of HiperDom (Re: XML Document DTML's tree, HiperDOM)
On Fri, Nov 10, 2000 at 10:28:44AM +, Chris Withers wrote: Oh yeah, while I'm here, how's the HiperDOM project getting on? That stuff would be raally useful for a project here... HiperDom is usable right now; we've been quite quiet because we're working on documentation and unit testing (and to have unit testing, we had to have ZUnit). The low version number is because we're not very sure about the syntax and we wanted feedback on it from the community. However, that just isn't happening, and we're tempted to call the results of documentation and testing 1.0, then after feedback and possible syntax modifications work on a 2.0. Right now, we would "raally" encourage you to use HiperDom in your project, specially if the deployment schedule = 2 months, and then please send us that feedback :-) []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 maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [zope] sudden ZClass breakage
Only seen a couple of posts on this and the suggested fixes did NOT work. My ZClass was working fine until I added a new string type property and now my date type property seems broken. At least broken when I attempt creating an instance via my custom add form. If I add an instance via the management screen it works fine. I have gone as far as scrapping my custom form and rebuilding it. I can't see any reason why I would be getting "Invalid Date-Time String", especially when it was working fine. I'm happy post my code if that will help. Any ideas?? Jamey -Original Message- From: Timothy Wilson [SMTP:[EMAIL PROTECTED]] Sent: Friday, November 10, 2000 4:46 PM To: James Sintz Subject: RE: [zope] sudden ZClass breakage On Fri, 10 Nov 2000, James Sintz wrote: Did you ever figure out how to fix your ZClass problem? I have a application I have been working on and and all of a sudden today I start getting the same error message "Invalid Date-Time String" . The odd thing is that it is only broken when I try and add an instance from my custom add form. When I use the management screen to add the instance my goLiveDate field works just fine. I've never gotten an answer. I figured I would work on other things and wait for 2.2.3 and see if that made any difference. If it doesn't, I'll make some more noise or dig in deeper and try to figure out what's going on. :-( -Tim Hi everyone, I've been working away on a ZClass-based product that will provide a searchable job board for our Human Resources Dept. here at school. Things were going along fine until, it seemed, out of the blue I started getting an error message about an "Invalid Date-Time String" and a lengthy traceback. I'm wondering if anyone can glean anything from the traceback. Is this one of those obvious errors that I'm just missing? I'm really puzzled. Any advice would be appreciated. -Tim ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] bookmark importer
"Philipp Dunkel" [EMAIL PROTECTED] writes: Hello guys I' have here a pyton file that allows you to import your bookmarks from IE. The following prob is that it works on windows98 zope 2.2.2 and not on a unix system. The file temp.txt stays empty and you get the message 'unable to export favourites' anyone any idea? Have you account for differing end-of-line conventions on the 2 platforms? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClasses inheriting property(sheets) : yes/no?
Thanks! I have a new question that may (?) be the same old one in a different form: The idea is to have two ZClasses, say Foo and Bar. Bar is a nested class of Foo. The Foo object should be able create n instances of the Bar objects and the Bar object should also be able to create n instances of other Bar objects. Creating Bar in Foo is no problem. Creating Bar in Bar is a problem since Zope won't display the interface for adding objects. Adding new Bars is selected in the permissions menu/tab for both ZClasses. Foo inherits ZClass:ObjectManager and Bar is a "child" of Foo. I've tried grovelling around the mailing-lists and seen discussions about inheriting OFS:Folder and/or issues of folderish-ness. I tried making Bar inherit OFS:Folder, but then I just got a popup menu that lets me create Foo, but not Bar. I'm confused and starting to feel like a bit of a dumb-ass. Can someone point me in the right direction? Thanks, On Fri, 10 Nov 2000, Jim Washington wrote: Hi, Aaron Yes. If your parent ZClass is constructed properly, you should be able to add the parent class's management tabs by setting a "view". On the "Views" tab, look in the Method list for propertysheets/[ParentClassPropertySheetName]/manage. The properties on that sheet are accessible just like any of the child class's properties. -- Jim Washington ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] why DTML confusing
Charlie Wilkinson [EMAIL PROTECTED] writes: ...or "the python world with some Zope limitations placed on it." ... There's a third world of course, HTML. Most of us probably have that True, true. Actually this sounds like a good structure for a overview doc: "Welcome to Zope.. in which we shall encounter 1. the plain of Text 2. the fields of HTML 3. the DTML domain 4. the ZClass lands 5. the Scripting realms; in which dwell Expressions, Methods and Python/Perl/XSLT" 6. the unbound Scripting realms; here be External Methods 7. the halls of the Serpent; where dwell it's Products Descend now into.. DC's Seven Circles Of Hell." (affectionately misnamed :-) -Simon ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Are there any man pages out there for these functions?
Howdy Folks, I'm looking for man pages on these dtml functions? I'm finding it terribly difficult and frustration to figure out how to properly program in dtml since I can't do a man on a funtion (ie:man objectValues) and read about what parameters the function is expection from me. I'd like to browse the dtml man pages and see what functions are available to me. I've been reading all kinds of documents for the last week but I get the feeling that Zope is somewhat immature as a product. So, any ideas about those man pages? Thanks in advance. John /\ | John Voth Mobiltex Data Ltd.Calgary, Alberta,Canada, T1Y-4T7 | | [EMAIL PROTECTED] 403-291-2770, 403-259-6795 (fax)| \/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Are there any man pages out there for these functions?
[EMAIL PROTECTED] wrote: Howdy Folks, I'm looking for man pages on these dtml functions? I'm finding it terribly difficult and frustration to figure out how to properly program in dtml since I can't do a man on a funtion (ie:man objectValues) and read about what parameters the function is expection from me. I'd like to browse the dtml man pages and see what functions are available to me. I've been reading all kinds of documents for the last week but I get the feeling that Zope is somewhat immature as a product. So, any ideas about those man pages? Yes, in Zope, click the 'Help' button. On the left is a navigation tree, open 'Zope Help' and then open 'API Documentation'. For documentation on 'objectValues' for example, look at the 'ObjectManager' API screen. It's not very discoverable; we need to work on making a better help interface. -Michel ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Are there any man pages out there for these functions?
John, Have you tried http://zdp.zope.org , in particular the Zope Quick Reference. Every Zope user/developer should use it as their bible. hth Phil [EMAIL PROTECTED] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 11, 2000 12:11 AM Subject: [Zope] Are there any man pages out there for these functions? | | Howdy Folks, | | I'm looking for man pages on these dtml functions? | | I'm finding it terribly difficult and frustration to figure out how to | properly program in dtml since I can't do a man on a funtion | (ie:man objectValues) and read about what parameters the function is | expection from me. | | I'd like to browse the dtml man pages and see what functions are | available to me. I've been reading all kinds of documents for the last | week but I get the feeling that Zope is somewhat immature as a product. | | So, any ideas about those man pages? | | Thanks in advance. | John | | /\ | | John Voth Mobiltex Data Ltd.Calgary, Alberta,Canada, T1Y-4T7 | | | [EMAIL PROTECTED] 403-291-2770, 403-259-6795 (fax)| | \/ | | ___ | Zope maillist - [EMAIL PROTECTED] | http://lists.zope.org/mailman/listinfo/zope | ** No cross posts or HTML encoding! ** | (Related lists - | http://lists.zope.org/mailman/listinfo/zope-announce | http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] logging for virtual hosts
Well, I tried the source hacking approach and seem to have found success with relatively little pain. In ZServer/medusa/http_server.py, the "log" method of the class "http_request" can be modified to report the request hostname which is readily available via the get_header method in the same class. Here is my modified "log" method: def log (self, bytes): user_agent=self.get_header('user-agent') if not user_agent: user_agent='' referer=self.get_header('referer') host=self.get_header('host') if not referer: referer='' self.channel.server.logger.log ( self.channel.addr[0], ' - - [%s] "%s" %d %d "%s" "%s" %s\n' % ( self.log_date_string (time.time()), self.request, self.reply_code, bytes, referer, user_agent, host ) ) Note that this puts the request hostname at the end of the log entry. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )