Re: [Zope] Stopping a dtml-in
At 1/17/01 10:24 PM, Tres Seaver wrote: "Jonothan Farr" [EMAIL PROTECTED] wrote: I also submitted it as a patch to the distribution but it was refused. Something about a new dtml-in implementation that I haven't seen materialize in the last 5 versions or so. The sentiment against "DTML-as-scripting-language" also makes introducing more control structures difficult to sell; I don't buy that, myself, but have to listen to folks who do. Some 8 months ago, I thought "break" was missing from dtml-in and wrote to this list. Within hours, clever solutions were suggested, the most impressive of which was Jonothan's patch mentioned above. I'm happy to see Tres saying that he doesn't buy the anti-DTML-scripting sentiment. To me, it makes little sense to create a language and then make it hard to use. Even less so when refusing an offered change that is more of a correction than it is an extension. Now just don't get me started on "_['index-whatever']" :-) -- Dennis Nichols [EMAIL PROTECTED] ___ 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-var expr=maand missing=1???
At 1/16/01 06:49 PM, Edwin Martin wrote: Hello, How can I use an undefined variable in an expression? I made a DTML document which gets parameters from the URL, like "/nieuw?maand=1". But I also want it to work when no parameters are given. How about dtml-unless maanddtml-call "REQUEST.set('maand',1)"/dtml-unless -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Calling other frames (OT)
At 1/16/01 08:58 AM, Curtis Maloney wrote: As for this frame problem... seems like you're voiding the best (IMHO) use of frames, which is to prevent reloading of portions of the page. Otherwise I just render all the objects into elements of an 'uber-table'... I agree with Curtis about frames providing the wonderful ability to reload part of the page without reloading and redrawing the whole mess. But... the frame most likely to be reloaded is the one with the content (as opposed to the navigation, advertisement, and other decorative frames) and if you don't reload the frameset then you can't bookmark that particular content. What to do about that? -- Dennis Nichols [EMAIL PROTECTED] ___ 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] log file.
At 1/11/01 12:25 PM, Oleg Broytmann wrote: On Wed, 10 Jan 2001, Jason C. Leach wrote: Is the Zope log file in Common Log File Format? Yes. You can run every standard log files analyzer on it. Using analog (http://analog.cx) against my Zope 2.2.2 logs, I found that the standard analog definition of the Common Log File Format didn't exactly match the Z2.log format. Specifically, Zope produces a host address followed by a colon, which confused a few of analog's reports. I currently use the following in my analog.cfg file... LOGFORMAT (%S: %j %u [%d/%M/%Y:%h:%n:%j] "%j%w%r%wHTTP%j" %c %b "%f" "%B") LOGFORMAT (%S: %j %u [%d/%M/%Y:%h:%n:%j] "%j%w%r" %c %b "%f" "%B") -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Design/DTML question
At 1/10/01 04:44 PM, Max Mller Rasmussen wrote: From: Timothy Wilson [mailto:[EMAIL PROTECTED]] Right now, I've got the dates stored in a TinyTable. I can iterate through that list and generate the links, but I can't figure out how to display the table in two columns. alternating column solution by Max M deleted for brevity Or, if you insist that dates flow down the columns like I do, you could use this untested revision of Max's solution: table width=100% border=0 cellpadding=4 tr align=left valign=top td width=50% dtml-in meetingDateTable dtml-if "_.int(_['sequence-index'])*2==_.int(_['count-id']) or _.int(_['sequence-index'])*2==_.int(_['count-id'])+1" /tdtd width=50% !-- moved to next column -- /dtml-if dtml-var meeting_datebr /dtml-in /td /tr /table Gosh, wouldn't it be nice to have a sequence-midpoint ? But then somebody would surely want a sequence-first-quartile and so on :-) -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Design/DTML question
At 1/10/01 01:22 PM, Timothy Wilson wrote: On Wed, 10 Jan 2001, Dennis Nichols wrote: Or, if you insist that dates flow down the columns like I do, you could use this untested revision of Max's solution stuff removed This doesn't seem to work. The if statement only evaluates to true the first time through the loop. Because the objects in the loop had no 'id' attribute? In any case, here's a complete tested example: dtml-var standard_html_header dtml-call "REQUEST.set('meetingDateTable',['first','second','third','fourth','fifth'])" table border=1 cellpadding=4 tr align=left valign=top td width=50% dtml-in meetingDateTable dtml-if "_.int(_['sequence-index'])*2==_.len(meetingDateTable) or _.int(_['sequence-index'])*2==_.len(meetingDateTable)+1" /tdtd width=50% !-- moved to next column -- /dtml-if dtml-var sequence-itembr /dtml-in /td /tr /table dtml-var standard_html_footer -- Dennis Nichols [EMAIL PROTECTED] ___ 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] IEMethod (was: Can Zope ... )
At 1/9/01 08:33 AM, Olaf Zanger wrote: Smith Ray schrieb: * Allows non technical people to create content plus add users / managers etc without any HTML knowledge or knowledge outside of the package. product: IEMethod wysiwyg even in internet explorer. really great! check it out I give up, what and where is IEMethod? Zope.org search turns up nothing. -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Newbie Questions
At 1/8/01 02:32 PM, Alex Reid wrote: - I am creating a 'form' method so I don't have to create separate forms for INSERT and UPDATE actions. This works, only how do I tell Zope to ignore the fact that dtml-var company_id doesn't exist when in INSERT mode? It is there in the value="" parameter for the edit mode to pre-populate the element. dtml-var company_id missing -- Dennis Nichols [EMAIL PROTECTED] ___ 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 I don't use popen2 any more
In the for what it's worth department... Using Linux (RH 6.2), Zope 2.2.2, Python 1.5.2 I wanted to run a unix command from my External Method that I wrote using Python. Digging around in Zope archives and other sources, I came up with a method that worked, of which this is a fragment: import popen2 (r, w) = popen2.popen2('somecommand') w.write(commandinput) w.close() s = r.read() r.close() However, this had the nasty side effect of leaving defunct processes around. I discovered one instance on the web of someone having this same problem using Python but not Zope-related. No solution was given. I *think* the really bad thing about these processes (called zombies?) is that they may have certain resources, such as files, held open. And they are said to stay around until the process that created them dies itself. The fix seems to be easier than the original solution. Replace all of the above with import commands s = commands.getoutput('echo ' + commandinput + ' | somecommand') Presto, no more defunct processes. Hopefully a more stable Zope. Keen observers will note the security risk if commandinput contains arbitrary input from users. Wasn't true for me but it might be for you. A curiosity: the description in Python Essential Reference says getoutput uses os.popen2() to execute the command, but I was too lazy^H^H^H^H busy to investigate further. -- Dennis Nichols [EMAIL PROTECTED] ___ 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-dev] Fault tolerance and thread-loss
At 12/18/00 09:58 PM, Tres Seaver wrote: I'm not really replying to either question, but guessing at the underlying cause of the problem: this smells *exactly* like the behavior induced by the "multiple PUT/POST" race condition bug, corrected by Evan Simpson's patched ZServer/HTTPServer.py: http://www.zope.org/Members/4am/postfixbug Or, even more, http://www.zope.org/Members/4am/postbugfix -- Dennis Nichols [EMAIL PROTECTED] ___ 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] The inverse of REQUEST.set is ??
I can do dtml-call "REQUEST.set('something','whatever')" Having done that, I'd like to be able delete 'something' and I do NOT mean just dtml-call "REQUEST.set('something','')" I want it gone! Come on, humor me... is there a good way to do this? -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Zope, squid, the Host header
The "How-To: Configuring Squid as an Accelerator for Zope" (http://www.zope.org/Members/htrd/howto/squid) by htrd doesn't entirely work for me and/or is over my head! My goal is to use Squid as an http accelerator in front of zope (using zserver, no apache) on the same machine. Secondary goal is to be able to access Zope directly also, but this is much less important. An alternate How-To by itamar (http://www.zope.org/Members/itamar/Squid) requires the use of SiteAccess, which I would like to avoid. Squid seems to be running OK (listening on port 8070, connecting to zope on port 8080) but wrestling with zope about the Host header has not yet produced a winner. Specifically, the How-To says: "If you will be always be accessing this Zope server through the accelerator then the easiest solution is to configure Zope to ignore the value of this header. Specify HTTP_HOST=www.myhost.com as either a command-line parameter to z2.py, or as an environment variable." I translate this to mean I could set and then export an environment variable that in my case would be HTTP_HOST=www.myhost.com:8070 since that's where the server should appear to be to the browser client. For whatever reason, this is not effective. I can tell because zope still works fine directly on port 8080 (through port 8070 I get the requested document, no images, and the baseref is still at port 8080). Inspection of HTTPRequest.py shows that it does a if have_env('HTTP_HOST'): host = strip(environ['HTTP_HOST']) hostname, port = splitport(host) and sees www.myhost.com:8080. Specifying the HTTP_HOST= on the command line has the same (non-) effect. I'd be pretty happy if I got either of those to work. I'd be even happier if I got the following to work, also quoted from the htrd How-To: "A better solution is to get Squid to rewrite the header to the correct value: 1. Compile squid using --disable-internal-dns. 2. Add a mapping from the name of your public server to the IP address of your Zope server in /etc/hosts 3. If you are running the Zope server on the same machine as the accelerator then: 1. Change the http_port line in squid.conf to bind only on the public network interface. 2. Use the -w switch to Z2.py to get Zope to bind to different network interface (possibly a loopback interface). Remember to change httpd_accel_host in squid.conf too. (Thank you to Henrik Nordstrom for showing me that solution.)" But I really don't understand this method... 1. OK, I know how to do the compile 2. /etc/hosts seem to map the other way, from the IP address of whatever to a name and some aliases. Does this mean that I should have a line 111.222.111.222 myhost.com myhost or is something else implied. 3.1 meaning "http_port myhost.com:8070" ? 3.2 this means? All help sincerely appreciated. -- Dennis Nichols [EMAIL PROTECTED] ___ 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 source
At 11/23/00 01:38 PM, Tom Deprez wrote: Are there some sites which publish there DTML source(structure)? I'm particulary looking on how several navigation, menu, ... structures are implemented in Zope. I use the following DTML Method (probably shouldn't be done in dtml) to produce a vertical, indented menu where folders are expanded to subfolders only if you're in one of the subfolders. Three custom folders are used to build the site (Category-Top, Category-Middle, and Category-Bottom). Each folder has a menu_entry property. A folder appears in the menu only if its menu_entry is non-blank. If you are currently in Pop Culture/Reviews/Books, the menu looks like this: Ask the Experts College Pop Culture Quiz Reviews Books Movies Music Trends Sports Here's the dtml. It's called display_menu and is recursive. Replace home_id_here with the id of the site's base folder. The base folder does not appear in the menu display. dtml-unless topdown dtml-call "REQUEST.set('topdown',[])" dtml-call "REQUEST.set('homefound','n')" dtml-in PARENTS skip_unauthorized dtml-if "homefound == 'n'" dtml-call "topdown.insert(0, _['sequence-item'])" dtml-if "_['sequence-item'].id == 'home_id_here'" dtml-call "REQUEST.set('homefound', 'y')" /dtml-if /dtml-if /dtml-in dtml-call "REQUEST.set('level', 0)" dtml-call "REQUEST.set('NodeToShow', topdown[0])" /dtml-unless dtml-if "level 0" dtml-with NodeToShow dtml-var "'nbsp;'*3*(_.int(level)-1)" a href="dtml-absolute_url;" class=toolboxdtml-menu_entry;/abr /dtml-with /dtml-if dtml-if "level _.len(topdown) and NodeToShow.id == topdown[level].id" dtml-in "NodeToShow.objectValues(['Category-Top','Category-Middle','Category-Bottom'])" sort=id skip_unauthorized dtml-if "_['sequence-item'].menu_entry" dtml-call "REQUEST.set('level', level+1)" dtml-call "REQUEST.set('NodeToShow', _['sequence-item'])" dtml-var display_menu dtml-call "REQUEST.set('level', level-1)" /dtml-if /dtml-in /dtml-if Not my finest piece of coding, but maybe it will help. -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Pseudo E-Mail Address validation
At 11/21/00 04:27 PM, Martin Winkler wrote: For a subscription tool of a mailing list I'd like to quick-check the e-mail address our users type. As a check on whether an email address *looks* OK, I use the following External Method. If ICANN really approves TLDs that are other than 2 or 3 characters long then the {2,3} will have to be changed. Warning: Some mail software between you and me may break up lines in the code. There are two executable lines, one starts with "m =" and the very next line starts with "return". There are no blanks in the r'...' string. import re def wellformedEmail(self, address): """ return true if email address appears to be well formed """ m = re.search(r'^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+[a-z]{2,3}$', address, re.IGNORECASE) return m != None and m.group() == address -- Dennis Nichols [EMAIL PROTECTED] ___ 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] overriding manage_beforeDelete in a CatalogAware Product
At 11/17/00 09:04 AM, Andy McKay wrote: But I'm confused about how to get rid of the index entry upon delete... You should just be able to do "self.manage_beforeDelete(..)" since you have inherited all CatalogAware's methods. Make sure you have CatalogAware as your first (left most) item in your classes inheritance. This might be right, but I didn't try it because next Andy said: Do you really need to set the catalog again? Isnt that already set in your class? I think I get a big "Well, duh!" here. Of course, if I do a "self.manage_editCataloger(...)" in my product's __init__ routine, that sets the catalog for the rest of the object's existence, not just the __init__ routine. And so I don't have to set it again in any edit routine, nor do I have to worry about the object's deletion. Tested and working. Many thanks. -- Dennis Nichols [EMAIL PROTECTED] ___ 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] overriding manage_beforeDelete in a CatalogAware Product
I think I need help in overriding the manage_beforeDelete method from CatalogAware. Just to be sure I'm asking the right question, here's the background: I have a Product (in Python, not TTW) whose instances get cataloged in a separate ZCatalog called CommentCatalog. My product's class inherits from CatalogAware and other classes and can successfully index itself by calling thusly in the __init__ routine: self.manage_editCataloger('CommentCatalog') self.index_object() Reindex also works just fine. But I'm confused about how to get rid of the index entry upon delete. I think I need to set the catalog name and then call the inherited manage_beforeDelete routine. So I tried this: def manage_beforeDelete(self, item, container): "Be sure we unindex ourselves from our special catalog" self.manage_editCataloger('CommentCatalog') self.CatalogAware.manage_beforeDelete(item, container) Not too surprisingly, the code throws an "AttributeError: CatalogAware" into the Stupid Log File and doesn't remove the object from CommentCatalog. Of course I don't understand what the correct incantation is, so I'm appealing for guidance. Zope 2.2.2, Python 1.5.2, RH 6.2, etc Thanks! -- Dennis Nichols [EMAIL PROTECTED] ___ 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-releasing mysqlUserFolder 0.5 ??
[EMAIL PROTECTED], vladap (who is listed as the author) - Just before zope.org's Data.fs developed that short circuit a day or two ago, there was a new revision of mysqlUserFolder released (0.5.0 if I remember correctly). I'd like to try it out if we could get it back on the Zope site. -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Zope.org down?
At 11/1/00 03:22 PM, Phil Harris wrote: Subject says it all Well, not here but it does seem to have fallen back one or more days. I'm also curious about the zope.org site performance. Zope is said to capable of a million hits per day on commodity hardware, yet zope.org receives only about 20% of that on its busiest days. This would not be remarkable except that the response times from zope.org seem to usually be 10 seconds or so. I am on a T-1 line and 13 hops and 80ms from the zope.org server. -- Dennis Nichols [EMAIL PROTECTED] ___ 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: [Zope-book] Re: [Zope] Zope Book Beta
At 10/31/00 11:08 PM, Wolfgang Strobl wrote: For example; I have HTML help versions _and_ printed copies of the - outdated - Zope docs, and one of each from the actual howto-collection, and I'm using them both. Wolfgang - How about putting up your HTML help version of the howto-collection? That would be very cool. Thanks! -- Dennis Nichols [EMAIL PROTECTED] ___ 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-dev] extending objectValues() and objectIds() or ?
Thanks for the advice (below). I added another parameter for meta type and everything works great. What's the advantage of using Python Method rather than an external method, other than thru-the-web editing? Any disadvantages? At 10/24/00 06:45 PM, Itamar Shtull-Trauring wrote: Write a Python Method (install the PythonMethods product first) called say, publishableObjectValues that does that: paramself/param # functions that returns publishable objects result = [] for o in self.objectValues(): if o.isPublishable(): result.append(o) return result -- Dennis Nichols [EMAIL PROTECTED] ___ 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] extending objectValues() and objectIds() or ?
I have developed a flock of Python products that have attributes 'first_date', 'last_date', and 'ok_to_publish' with the intention that these attributes will be set by the content managers. Each product also has an 'isPublishable' method that returns true if 'ok_to_publish' is true _and_ today = 'first_date' _and_ today = 'last_date'. This all works fine but I find myself writing DTML in many places to retrieve a list of objects with objectValues() and then looping over them making yet another list of only the objects that are publishable. What I would really like is an objectValues() and an objectIds() that return only publishable objects/ids. It looks like this could be easily accomplished by {tremble} adding an additional parameter to those two routines, say chkPub=None so that I could do a call such as objectValues('Poll',1) when I wanted just the publishable Poll items returned. However... 1. modifying ObjectManager.py doesn't seem like the best move I've ever thought of 2. I'm confused about the ObjectManager internals - can I call my isPublishable methods on objects that ObjectManager keeps in its lists? How? I guess a better question, rather than asking about this one possible solution, would be: How can I extend Zope to give me a list of objects qualified by more than just the meta_type? Guidance gleefully gathered. Thanks! -- Dennis Nichols [EMAIL PROTECTED] ___ 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] how to include Flash/SWF objects in Zope website?
At 10/16/00 02:21 PM, Fred Yankowski wrote: Thank you both for the help. File objects are just the ticket (but it turns out that Image objects work nearly as well). For the record, here's what I did: In order to provide alternate content and/or detect which level of Flash player is present, you might want to also include the free Moock "fpi" (f.lash p.layer i.nspector) found at http://www.moock.org/webdesign/flash/detection/moockfpi/ -- Dennis Nichols [EMAIL PROTECTED] ___ 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] fmt=structured-text seems wrongish
Not to throw stones, just trying to understand. WRT dtml-var ... fmt=... It makes sense to me to use "fmt=something" when the something is an instruction on how to format a number or how to format the time. In those cases, I'm simply saying how I want the number or time to appear. But when I say "fmt=structured-text" then I'm saying how the item is stored. Let's say that I've developed a Python product that contains description and now I've made an instance of it as myDoc. Within my site (application), I can ask that description be rendered this way... dtml-var "myDoc.description" fmt=structured-text By doing so, I'm telling Zope that whatever it finds in myDoc.description should be interpreted according to structured text rules from markup contained within myDoc.description itself. Now how does my application know that the myDoc object has structured text stored in description? Shouldn't the object itself know that? And shouldn't the fmt specification tell how myDoc.description is to be presented instead of how it is stored? For example, let's say I can choose to store description as plain text, as structured text, or as html. Regardless of how it is stored, I might want to ask for it as: fmt=raw in case I want to edit it fmt=html in case I want to send it to a browser and so on. Here, raw and html don't describe how to interpret the contents of myDoc.description, just how to give it back. Pointers? I guess I can just fix this within my own product(s) by returning various fields in a manner something like this: Stored as STX, return as HTML return str(StructuredText.HTML(self.description)) Stored as STX, return as raw, or stored as HTML, return as HTML return self.description and so on... -- Dennis Nichols [EMAIL PROTECTED] ___ 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] AUTHENTICATED_USER (or something) making me crazy
If I inspect REQUEST by inserting a dtml-var REQUEST in my dtml I can see that AUTHENTICATED_USER is set to Anonymous User. Yet when I insert the following code, it never displays Guest. It takes the else branch and then, perversely, displays Anonymous User. Please point out my stupid mistake. dtml-if "AUTHENTICATED_USER=='Anonymous User'" Guest dtml-else dtml-var AUTHENTICATED_USER /dtml-if Thanks. Maybe I shouldn't work on Saturdays. Zope 2.2.2 roughly, Python 1.5.2, RH 6.2 -- Dennis Nichols [EMAIL PROTECTED] ___ 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] BTreeFolder (easy?) questions
1. Can I blithely use BTreeFolder in place of Folder without loss of functionality? 2. Can I successfully inherit from BTreeFolder in ZClasses (assuming that I uncomment registerBaseClass, which has been commented out in all BTreeFolder versions so far)? -- Dennis Nichols [EMAIL PROTECTED] ___ 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 I suppress newlines/whitespace in DocumentTemplates?
At 9/19/00 03:11 PM, Skip Montanaro wrote: I'd like to structure my DTML so it is vaguely readable: dtml-var "_['start'].strftime('%m/%d%y')" dtml-if "start != end"-- -dtml-var "_['end'].strftime('%m/%d%y')" /dtml-if-- This means inserting newlines and doing some indenting. Unfortunately, since I'm generating plain text, the newlines and indentation count (unlike with HTML)... Even in HTML, the indents and newlines count by showing up as a space before the '-' in the above example. You can fix this with good readability simply by "delaying" the closing ''. For example, dtml-var "_['start'].strftime('%m/%d%y')" dtml-if "start != end" -dtml-var "_['end'].strftime('%m/%d%y')" /dtml-if -- Dennis Nichols [EMAIL PROTECTED] ___ 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] restrictedTraverse - yay! :-)
At 9/15/00 10:05 AM, Chris Withers wrote: So: dtml-var "restrictedTraverse('slash/delimited/path')" absolute_url will work as I expect it to? Well, I don't know what you expect :-) When I try to save such a construct with the handy-dandy Change button I get Document Template Parse Error Invalid attribute name, "absolute_url", for tag dtml-var "restrictedTraverse(choice)" absolute_url ... -- Dennis Nichols [EMAIL PROTECTED] ___ 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] Underscore Caracter
At 9/5/00 09:54 PM, Chris McDonough wrote: It should be noted that _.string.replace() is not mentioned in the DTML reference guide. If it exists, it should be used. Sigh. I can't wait for the Zope Book to come out, I'm going to be the first buyer. ;-) Not that I would expect it to exist, but according to "Python Essential Reference" p. 117, it is indeed present in the string module: replace( str, old, new [,max] ) -- Dennis Nichols [EMAIL PROTECTED] ___ 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 )