[Zope] Re: JSON for Ajax applications
Fri, 23 Sep 2005 12:27:34 +0200 keltezéssel Jean-Marc Orliaguet azt írta: > Max M wrote: > >> I don't know how many has seen this, but it's pretty cool. >> >> JSON (JavaScript Object Notation) is a lightweight data-interchange >> format. >> >> http://www.crockford.com/JSON/index.html >> >> It is used for Ajax applications to transfer data instead of xml. It >> uses repr() versions of standard python objects like dicts, lists, >> string, numbers etc. to transfer data. >> >> It is really simple to generate for Python programmers, so it is very >> simple to use in Zope too. > > this is used at 100% and more in cpsskins for Zope3 (cf. z3lab.org). You > might also have a look at Jim Washington's 'jsonserver' for Zope3 and its > implementation for Zope2 http://zif.hill-street.net/jsonserver > I would add that I made up the Zope2 server implementation, sorry I did not announce it on the list. Works perfectly for Zope and Plone. It is currently tested only with Zope 2.7, did not try it on 2.8. You can read more about the Zope2 implementation and download it at: http://www.zope.org/Members/ree/jsonserver2 I also added some simplistic but fully functional examples that help you start with it. I would encourage everyone using it for Zope/Plone. In case of bugs or suggestions, please mail directly to me. I also plan to make some minor update to catch up with newest version of jsolait, as soon as I have some free time. Also I would like to add some yet simple but more real-life examples that would also include usage with Zope, Plone and Archetypes. If you have any good idea for this, please also write to me. Thanks, -- Bala'zs REE' jabber + email: [EMAIL PROTECTED] ICQ: 75955071 AIM + skype: reebalazs ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing args to PageTemplateFile instances
2005/9/23, Anders Bruun Olsen <[EMAIL PROTECTED]>: > On Fri, Sep 23, 2005 at 12:39:31PM +0100, Peter Bengtsson wrote: > > RESULT: > > --- > > Welcome to testprod > > {'args': (, > > http://localhost:8080/test/testprod/test_testprod>), > > 'something': 'blah'} > > 0 > > /test/testprod > > > > http://www.peterbe.com/test/TestProd.tgz > > So it works just fine in Zope 2.8.0 > > I suspect that the code you paste was idented wrong because the def > > testit() function looked like it was part of the __init__ function. > > Yes, the paste was wrong, but there was more than that, I had my editor > slightly misconfigured, which meant that the testit method was done with > tab-indention and the rest of the file with space-indention. After I > fixed that, it worked correctly and "something" shows up in options. I > am absolutely stumped by why an indention problem can cause such a weird > bug. I would have expected Zope/python to spew out an error telling me > that indention was fucked up. To just silently make things not work is > definitely not nice. > > Anyway, thank you so much for your help! > I'm still not convinced. The tabbing should either have led to a SyntaxError or to testit() becoming a nested method. If it was a nested method you wouldn't be able to reach it via the web like http://localhost:8080/testprod/testit But let's drop this now :) If you're struggling with getting your editor to only use spaces correctly you can ask the list for advise since there are many different python progammers here with the same experience. -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Multiple ZODB for virtual hosts with ZEO
Hi Dieter. I guess the bottom line is to evaluate configurations and weigh them against your resources, needs, risks, etc and then make a decision. The great thing is that Zope is flexible and as a result there are interesting options to consider. Your feedback has been helpful. Many thanks. Regards, David On Friday, September 23, 2005, at 02:03 PM, Dieter Maurer wrote: David Pratt wrote at 2005-9-22 17:50 -0300: ... I am interested in what you might recommend when you are dealing with a number of virtual sites of the smaller zodb scale since this is really the issue I am attempting to solve. I definitely like the features ZEO has to offer as far as asynchronous maintenance, etc. I have no experience with this. My experience is with huge ZODB storages -- containing everything, even large binary objects. It copes quite well. How to proceed with lots of small virtual sites heavily depends on your ressources. If I had plenty of resources, I would each give its own Zope instance -- to make then as independent from one another as possible. If my resource were very tight, I would use a single Zope instance and a single storage to spare resources as much as possible. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to create an ansynchronous method
Hi Chris. I downloaded ZASync and did a bit of reading and comparing between your Stepper product as well. ZASync at present relies on an older version of Twisted which is now I think into the 2 series so maybe later the products will come together this way. I think Stepper is really interesting.I think it would be a really good thing to see fire and forget with a process you create as a series of steps that can also be queued in one or more queues. I also think there is some interesting possibility for something like a Zope instance Stepper where you could trigger a generic daemon to run a thread to process asynchronous tasks (steps) without a ZEO requirement. The asynchronous jobs could be queued for long running tasks outside of zope or timed to inject the step requests into zope for the maintenance of a zope instance (in the same vein as ClockServer) but in a single product. Regards, David On Friday, September 23, 2005, at 05:33 PM, Chris Withers wrote: Hi David, Just a note in passing to say that what you're really after in this case is Gary Poster's ZASync. Gary's talked to me about getting Stepper (which is basically batch processing triggered via cron using a ZEO connection) to do the work of processing ZAsync's queue, which would be cool, but I don't know if either of us has the need/time to make that happen... ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] securing webdav
Hi Tino. Over HTTP is not the problem. It is more on normally https you are rewriting your requests to port 443 with apache proxy and your usual webdav server is port 1980 that is not secure. I am in the same boat as David. I haven't got my webdav running securely at this point either. The only thing I have heard about is the running m2crypto with ZServerSSL but I have read mixed reviews so have been reluctant to install it. Either way I am looking for something also for securing webdav and ftp as well. As far as sftp I know that Zope Corp has a product in CVS but I have not heard whether it works or if anyone is using it. It relies on on the deprecated Twisted 1.1.1 which is at least 2 or 3 years old. I read earlier today of a product called scponly that could help but it looks like it has had some history of vulnerability so not so sure about this solution at this point either. Regards, David On Friday, September 23, 2005, at 09:01 PM, Tino Wildenhain wrote: Am Freitag, den 23.09.2005, 16:08 -0700 schrieb David Bear: I run zope in back of apache, and let apache handle tls/ssl. In all the searching on zope.org though I haven't found any documents on how to let apache handle securing webdav for zope as well. Anyone see/written such? webdav works over http - yes, the same http your browser uses. Apache handles this fine. Nothing to do. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] securing webdav
Am Freitag, den 23.09.2005, 16:08 -0700 schrieb David Bear: > I run zope in back of apache, and let apache handle tls/ssl. > > In all the searching on zope.org though I haven't found any documents > on how to let apache handle securing webdav for zope as well. > > Anyone see/written such? webdav works over http - yes, the same http your browser uses. Apache handles this fine. Nothing to do. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] filesystem directory view
Hi David. I would recommend at the blob product. I have been using it with success in CMF. I would consider it a starting point for where you may want to take it. If you are looking for something already developed and ready to go, I would recommend ATManagedFile from Enfold if you plan on using Plone. It can do a great job of managing files on the filesystem where your objects also behave as proper citizens in zope. It is subclassed from ExternalFile and CMFManagedFile. I contributed documentation for it a while back and it also worked nicely. Hope that helps. Regards, David On Friday, September 23, 2005, at 02:23 PM, David Bear wrote: I have cmf1.4.7 installed on zope 2.7.4. I also have plone installed. All seems to work well. I'm trying to use the file system directory view product to build a simple graphics library. My thinking was to store all images on the unix file system, then let some store some meta data on each image. Trouble is, I'm not finding any 'beginning' documentation on using file system directory view. seach zope.org yeilds hundreds of hits. I've looked through the install tree for zope and cmf and am not finding any usefull README's there either. so my first question is where is a good HOWTO on using filesystem directory view (I've got both the fdv that came with cmfcore and one that came with plone). my second question is, .. is file system directory view what I want. Again, I want to store files in the unix file system, expose those to zope, then store meta data on each of those image in zodb. -- David Bear What's the difference between private knowledge and public knowledge? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] securing webdav
I run zope in back of apache, and let apache handle tls/ssl. In all the searching on zope.org though I haven't found any documents on how to let apache handle securing webdav for zope as well. Anyone see/written such?-- David BearWhat's the difference between private knowledge and public knowledge? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] how determine all Zope/Plone dependencies for chroot jail?
[EMAIL PROTECTED] wrote: I'd like to run Zope/Plone in a chroot jail. How determine all dependencies to make this possible?? (What does it need outside of the zope instance home?) Go ahead and create the 'jail' and add what files you think it needs, and keep adding missing files until it works. Since symbolic links will not, you could hard link directories, but be careful when you do it *AND* be aware that it exposes your actual system files to the process within the 'jail'. Copying is much safer. get familiar with ldd(1) -- it's your friend. - N ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing args to PageTemplateFile instances
On Fri, Sep 23, 2005 at 12:39:31PM +0100, Peter Bengtsson wrote: > RESULT: > --- > Welcome to testprod > {'args': (, > http://localhost:8080/test/testprod/test_testprod>), > 'something': 'blah'} > 0 > /test/testprod > > http://www.peterbe.com/test/TestProd.tgz > So it works just fine in Zope 2.8.0 > I suspect that the code you paste was idented wrong because the def > testit() function looked like it was part of the __init__ function. Yes, the paste was wrong, but there was more than that, I had my editor slightly misconfigured, which meant that the testit method was done with tab-indention and the rest of the file with space-indention. After I fixed that, it worked correctly and "something" shows up in options. I am absolutely stumped by why an indention problem can cause such a weird bug. I would have expected Zope/python to spew out an error telling me that indention was fucked up. To just silently make things not work is definitely not nice. Anyway, thank you so much for your help! -- Anders -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y? --END GEEK CODE BLOCK-- PGPKey: http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0xD4DEFED0 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: schema won't update - persistant .pyc files??
Alexander Limi wrote: On Fri, 23 Sep 2005 23:18:49 +0200, Chris Withers <[EMAIL PROTECTED]> wrote: Does anyone know if the other Members-as-content product that I've seen out there is any better than CMFMember, which is pretty horrific, by all accounts? Have a look at Membrane in the Collective - the rewrite Helge just started doing (aims to do less than CMFMember, and do it efficiently). Yep, that's the one I was thinking of, will be interesting to see how it turns out... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Re: schema won't update - persistant .pyc files??
On Fri, 23 Sep 2005 23:18:49 +0200, Chris Withers <[EMAIL PROTECTED]> wrote: Does anyone know if the other Members-as-content product that I've seen out there is any better than CMFMember, which is pretty horrific, by all accounts? Have a look at Membrane in the Collective - the rewrite Helge just started doing (aims to do less than CMFMember, and do it efficiently). -- _ Alexander Limi · Chief Architect · Plone Solutions · Norway Consulting · Training · Development · http://www.plonesolutions.com _ Plone Co-Founder · http://plone.org · Connecting Content Plone Foundation · http://plone.org/foundation · Protecting Plone ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Log aggregator?
When you get a solution let me know. I am in the middle of log hell at the moment (including Zopes logs) trying to get things to sync up properly across multiple machines. When my stuff works, I'll share. -d On Fri, 23 Sep 2005, Paul Winkler wrote: > Anybody know of any software that will aggregate logs in a variety > of formats and allow me to correlate events in one log with another? > > I'm getting really REALLY tired of eyeballing and grepping a multitude > of logs on different servers, mentally translating incorrect timestamps, > and trying to work out what the heck from one log corresponds to something > in another. Anytime something goes wrong, i waste a huge amount of time > on this. > > Well, duh, this should be automated, right? > > I googled a bit and came up with nothing useful; > then I started hacking up a python script, which I'm sure I could > do in an hour or three, but - blah, it would be a huge timesaver if > somebody had written something like this already. > > I need to handle: > > * Different log formats. I'm mainly interested in the zope access log > format (aka apache format) and the zope event log format. > Must tolerate malformed lines like the #!@)%* ftp lines in the zope access > log. > > * System clocks being incorrect. > On some of the servers I work with, I am not the primary admin and can't do > much about the [EMAIL PROTECTED] clock being wrong. (*cough* firewall blocking > ntp for no good reason *cough*) > So I'd like the software to let me specify how far wrong > the various logs are, and compensate. > > * Servers in different time zones. Rare for me, but it does come up. > > * Filtering based on arbitrary strings, or (better) regular expressions, > on a per-log basis. > > * Multi-megabyte logs. Sometimes i go to check a log and sysadmin has > forgotten to rotate ever... > > -PW > > > > ___ > Zope maillist - Zope@zope.org > http://mail.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev ) > -- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] PrincipiaSearchSource and ExtFile
Dear members, On my installation of zope 2.7 I am trying to catalog content which is html text contained in Files and properties associated with ExtFiles. I am using TextIndexNG (v2.08). I can create the TextIndexNG index with the attributes eg Author, PrincipiaSearchSource, but when I then add an ExtFile I get the broken ExtFile icon returned (although the ExtFile is added successfully) and I am not able to catalog the ExtFile. Is anyone aware of an incompatability between TextIndexNG, PrincipiaSearchSource and extFile or give me any hints about why this might be happening ? Thanks, Alison ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Log aggregator?
Anybody know of any software that will aggregate logs in a variety of formats and allow me to correlate events in one log with another? I'm getting really REALLY tired of eyeballing and grepping a multitude of logs on different servers, mentally translating incorrect timestamps, and trying to work out what the heck from one log corresponds to something in another. Anytime something goes wrong, i waste a huge amount of time on this. Well, duh, this should be automated, right? I googled a bit and came up with nothing useful; then I started hacking up a python script, which I'm sure I could do in an hour or three, but - blah, it would be a huge timesaver if somebody had written something like this already. I need to handle: * Different log formats. I'm mainly interested in the zope access log format (aka apache format) and the zope event log format. Must tolerate malformed lines like the #!@)%* ftp lines in the zope access log. * System clocks being incorrect. On some of the servers I work with, I am not the primary admin and can't do much about the [EMAIL PROTECTED] clock being wrong. (*cough* firewall blocking ntp for no good reason *cough*) So I'd like the software to let me specify how far wrong the various logs are, and compensate. * Servers in different time zones. Rare for me, but it does come up. * Filtering based on arbitrary strings, or (better) regular expressions, on a per-log basis. * Multi-megabyte logs. Sometimes i go to check a log and sysadmin has forgotten to rotate ever... -PW ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to create an ansynchronous method
On Fri September 23 2005 04:31 pm, Chris Withers wrote: > Ron Bickers wrote: > > I have no idea. Maybe it'll do what you want, but I don't understand > > what it really does just from the description. The work I needed to do > > was external to Zope anyway (reading data from a MySQL database, > > building PDFs with Reportlab, sending email), so it's actually better > > that I'm outside of it. > > The open source Reportlab library right? > From what I've seen of their closed source stuff, it's way fast enough > to do this all on the fly... What I was doing wasn't fast enough; there were plenty of complaints from customers. But to be fair, it wasn't Reportlab that was slow. The process had to retrieve hundreds (sometimes over a thousand) of name/address records from a database, calculate the length of the longest line in each when printed with a given font, pass that information to Reportlab to format a page that would print each address centered on a label (not center-aligned, but left-aligned with the whole thing in the center of the label), attach the resulting PDF to an email and send it on. I suspect the slowest part was going through each of the hundreds of records and calculating the size, but it really didn't matter; the whole thing took too long to do on the fly. Reportlab is *nice*, BTW. -- Ron ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] how determine all Zope/Plone dependencies for chroot jail?
[EMAIL PROTECTED] wrote: I'd like to run Zope/Plone in a chroot jail. How determine all dependencies to make this possible?? (What does it need outside of the zope instance home?) Just the Zope software, and a python install, should be pretty simple... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] runzope vs zopectl fg ?
Simon Michael wrote: Question: is runzope now equivalent to zopectl fg (turning on debug mode for you etc.) and if so could we drop it ? They're the same, but zopectl actually calls runzope, so no, we can't drop it ;-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: schema won't update - persistant .pyc files??
Does anyone know if the other Members-as-content product that I've seen out there is any better than CMFMember, which is pretty horrific, by all accounts? (try lots of member,s high load, and watch the conflict errors pour in ;-) Chris Peter Bengtsson wrote: 2005/9/22, michael nt milne <[EMAIL PROTECTED]>: Haven't read anything about that button. Are you using CMFMember?I'm also using Plone 2.1 Yes, that was CMFMember with plone 2.0 -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] reading values from radio buttons (python script)
Lennart Regebro wrote: Because the people who designed the HTML form functionality are brain dead morons, "Not checked" and "not existing" is the same thing. Therefore you need to do this: request.form.get('fieldname', False) Or, perversely, put in a 2nd hidden field, named something like fieldname_included, if you really want to tell the difference between the field being on the form and just unchecked... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] create a new log file
Andreas Jung wrote: I think you can not reuse the zLOG API of Zope for custom logfiles. You need to implement your own logging based on the Python 'logging' module. Check the Python documentation for information for details. Well, he may just be fine specifying an additional handler in zope.conf. That said, I'd love to one day have the time to really let zope.conf support multiple log streams like ZConfig does... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Output only the first or a particular record using TAL
Julian Yap wrote: I used the following and it works great (without some formatting for clarity): Customer: hmm, this strikes me as just plain wrong :-S Why is getCustomerLicenses returning more than one row if you only want the first one? If it only returned one row, then you could do: Customer: ...no need for the condition or the yucky integer indexes. Now, if you really can't stop your sql returning more than one row (LIMIT 1 anyone?) then how about: Customer: cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Zope iso-8859-1 to utf-8
Also, watcha out for the gotcha in BaseResponse.py, which can end up doing a default encoding to latin-1 in some circumstances. I really want to make that hard coded thing configurable in zope.conf at some stage... Chris Pascal Peregrina wrote: I see... And what python function would you use for conversion ? I made some tests and was surprised of the results... I switched ZMI to UTF-8 (management_page_charset) and edited some of my documents / properties and all went fine. The generated documents are still sent to browsers as iso-8859-1, and are not broken. So my question would be : which valid UTF-8 characters (for typical Western languages like English, French, Spanish, ...) would be invalid in iso-8859-1 ? Last thing, if ZMI is switched to UTF-8, then what is the difference between ustring/string, etc properties ? Thanks. Pascal -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Max M Envoyé : mardi 13 septembre 2005 14:51 À : zope@zope.org Objet : [Zope] Re: Zope iso-8859-1 to utf-8 Pascal Peregrina wrote: Hi, I have been running a Zope installation for 2 years, so there are now lots of objects, properties, etc... I would like to know what are the possible issues I may have to face if I change the default encoding for iso-8859-1 to utf-8 in ZMI. You must write a script that converts any property on any object in your site that is latin-1 to utf-8. So first find all objects you use. See what types they are. Find all text and string attributes on those opjects. Write a function that converts from latin to utf and run that on every object. The hard part will be finding all the attributes, but perhaps you can write a method that can help find those properties for you using introspection. -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] how dump Zope database content into a file system directory tree?
[EMAIL PROTECTED] wrote: Possible to dump content in Zope database into a file system tree? What is your aim here? What Zope products are you using? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] filesystem directory view
> my second question is, .. is file system directory view what I want. > Again, I want to store files in the unix file system, expose those to > zope, then store meta data on each of those image in zodb. What metadata do you want to store? and, can you store that in the filesystem too? With FSDV's you normally store metadata for the file named 'foo' in a file named 'foo.metadata'. There are some examples under the 'tests' directory of CMFCore. -PW ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to create an ansynchronous method
Hi David, Just a note in passing to say that what you're really after in this case is Gary Poster's ZASync. Gary's talked to me about getting Stepper (which is basically batch processing triggered via cron using a ZEO connection) to do the work of processing ZAsync's queue, which would be cool, but I don't know if either of us has the need/time to make that happen... cheers, Chris gary's talked with me about doing the David Pratt wrote: Hi Ron. I found the following trying to follow up a bit on what you have suggested. I believe it is similar to what you are doing from your explanation. It may be out of date. I have not attempted to daemonize a process to date so it would be great if you could look at this and comment since I need something to work with. http://mail.python.org/pipermail/python-list/2001-February/030814.html As far as interacting with Zope, I have done something similar to build a site remotely from another server but setup https and sent credentials in the urls. I wonder if there is a way to inject them into Zope another way since the daemon is on the machine. I think the ClockServer injects requests into Zope. I believe it is something similar since credentials still need to be in url to execute something but requests are not exposed to the web doing this. Regards, David On Wednesday, September 14, 2005, at 12:11 AM, Ron Bickers wrote: On Tue September 13 2005 08:16 pm, David Pratt wrote: How is it that you send a signal to the long running process? The long-running process writes a pid file and waits for a SIGUSR1 signal (using Python's signal module). A small External Method, called when the user submits the form, reads the pid file and sends the signal to the process. Is the long running process cronned to look for a record in the database or is this starting another server of some type. It waits for a SIGUSR1 signal from the website, otherwise it's idle. That way it can begin processing immediately but doesn't have to do any periodic checking. I do, however, have a cron job that starts it every 15 minutes in case it dies. The process knows if it's already running, so it's safe to just start it regularly. What I need is something like what you are suggesting - wakes up when there is work in the hopper and chugs along until it is done and then goes to sleep (sort of the way a printing queue works). At the same time it would be great if it was something that had a small RAM footprint or ran without consuming any more than X mbs. The part that waits for the signal is very small, but it loads the Reportlab modules and reads a bunch of data to do the work, so it can get large at times. If it were to just call an external program that dies after doing its work, you could easily keep memory usage low. The other problem I have with this is that it needs to do work in Zope itself since the final docs end up as objects. I have just found Chris Wither's product called Stepper. I am not sure it this is for this type of situation or more for cronned maintenance. I have no idea. Maybe it'll do what you want, but I don't understand what it really does just from the description. The work I needed to do was external to Zope anyway (reading data from a MySQL database, building PDFs with Reportlab, sending email), so it's actually better that I'm outside of it. When I have to run things in Zope from outside, I run curl with a URL of a Python Script that does the work. It's a hack, but I've never had a problem with it. I'm not sure how else you would work in Zope from a process outside of Zope. -- Ron ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to create an ansynchronous method
Ron Bickers wrote: I have no idea. Maybe it'll do what you want, but I don't understand what it really does just from the description. The work I needed to do was external to Zope anyway (reading data from a MySQL database, building PDFs with Reportlab, sending email), so it's actually better that I'm outside of it. The open source Reportlab library right? From what I've seen of their closed source stuff, it's way fast enough to do this all on the fly... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Multiple ZODB for virtual hosts with ZEO
David Pratt wrote at 2005-9-22 17:50 -0300: > ... >I am interested in what you might recommend when you are dealing with a >number of virtual sites of the smaller zodb scale since this is really >the issue I am attempting to solve. I definitely like the features ZEO >has to offer as far as asynchronous maintenance, etc. I have no experience with this. My experience is with huge ZODB storages -- containing everything, even large binary objects. It copes quite well. How to proceed with lots of small virtual sites heavily depends on your ressources. If I had plenty of resources, I would each give its own Zope instance -- to make then as independent from one another as possible. If my resource were very tight, I would use a single Zope instance and a single storage to spare resources as much as possible. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How modify *path* of a 'zope instance home' ??
[EMAIL PROTECTED] wrote at 2005-9-22 20:56 -0700: >I tried modifying paths to 'zope instance home' in >bin/runzope, bin/runzope.bat and etc/zope.conf. > >I also tried just doing a symbolic link from old path >to new location of 'zope instance home'. > >NOTHING WORKS Then, apparently, you do something wrong... >I get errors about Zope/Plone not being able to load Archtypes >product. > >**Is the old zope instance home _path_ burned into a binary >somewhere that cannot be changed??** No. >e.g. Does Data.fs depend on old path somehow?? No. >HOW CHANGE PATH OF ZOPE INSTANCE HOME??? The most natural way should work... The most natural way is calling "bin/mkzopeinstance.py". Use an instance directory without a "bin" or "etc" directory, because "mkzopeinstance.py" will not overwrite existing files (which it places in "bin" and "etc" subdirectories). -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] filesystem directory view
I have cmf1.4.7 installed on zope 2.7.4. I also have plone installed. All seems to work well. I'm trying to use the file system directory view product to build a simple graphics library. My thinking was to store all images on the unix file system, then let some store some meta data on each image. Trouble is, I'm not finding any 'beginning' documentation on using file system directory view. seach zope.org yeilds hundreds of hits. I've looked through the install tree for zope and cmf and am not finding any usefull README's there either. so my first question is where is a good HOWTO on using filesystem directory view (I've got both the fdv that came with cmfcore and one that came with plone). my second question is, .. is file system directory view what I want. Again, I want to store files in the unix file system, expose those to zope, then store meta data on each of those image in zodb.-- David BearWhat's the difference between private knowledge and public knowledge? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] ZSQL pluggable brains
Hi I have been using ZSQLMethods object some with some without pluggable brains. I have come across a problem where the results of the sql query are not refreshed even thought the database is updated. I have noticed that the problem only occurs to those ZSQLMethods that have pluggable brains. It doesn’t happen all the time. Has anybody come across a similar problem? Chris Hoy ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How modify *path* of a 'zope instance home' ??
> I tried modifying paths to 'zope instance home' in > bin/runzope, bin/runzope.bat and etc/zope.conf. Note that runzope.bat is only relevant on windows, and runzip is only relevant on unix/linux/OSX. If you're on *nix, you also need to modify bin/zopectl if you use it. Also check the paths to all the other defined variables. e.g. ZOPE_HOME, CONFIG_FILE, SOFTWARE_HOME, PYTHONPATH. > **Is the old zope instance home _path_ burned into a binary > somewhere that cannot be changed??** It should not be. > e.g. Does Data.fs depend on old path somehow?? There used to be problems with skin directories keeping old paths, but that may be fixed. See http://zopelabs.com/cookbook/1021216110 I have not had any such problems in a long time, but I'm not sure if that's because it's fixed or because I haven't tried to break it :) -PW ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: CPSSkins perfs
N.Davis wrote: > Jean-Marc Orliaguet wrote: > >> >> Hi! >> >> I usually don't read the posts on zope-list, but I found this one: >> http://mail.zope.org/pipermail/zope/2005-September/161330.html >> >> sorry this is a bit old, but ... >> >> M. Davis, what are your benchmark figures based on? >> >> I just ran a quick benchmark on Plone's front page and found: >> >> siege -v -r 10 -c 1 http://localhost:8080/plone >> ** siege 2.61 >> ** Preparing 1 concurrent users for battle. >> The server is now under siege... > > Jean-Marc, > Hello. To be honest I didn't actually benchmark this scientifically. > So very sorry if I did a bad thing and made a statement against the > performance of CPSSkins that is not actually true. Hi Nick! Again I think that you are assuming things... > > I liked the look of CPSSkins, but looked into it a bit and thought, > this does too much , its too clever. That means the rendering is more > complex which will hit performance. Also a sophisticated product is > possibly more likely to break doing a migration such as to Plone 2.1. the support for plone2.1 will be available soon, when I get the time to do a release. The actual changes to support plone2.1 are trivial, basically small API changes and a new template for the preference panel. They are summarized here: http://svn.nuxeo.org/trac/pub/changeset/24294 So If plone2.1 was to cause CPSSkins to break it would also break the hundreds of thousands of sites that have customized the plone skins. > Its a more complicated product to maintain perhaps. Thats not entirely > scientific either because something well-written by good programmers > who understand Plone well may be more "migration-proof" than a simpler > but sloppier-written Product. But I take an attitude that while > Zope/Plone is great, a certain amount is still bleeding edge and > brittle, so don't try to be too clever. My colleague got burnt by > pushing the limits of a bleeding edge version of Archetypes (1.2.5). > We're still struggling to migrate to 1.3.4. On the other hand some > people need to push the limits in order that advanced features get > their bugs found and fixed. I think that I usually spend about 1 hour a month on the Plone version of CPSSkins, keeping up with the changes in Plone. CPSSkins works on CMF, CPS, plone so 95% of the code is completely independent of Plone. The only part that needs to be updated are the skins located in http://svn.nuxeo.org/trac/pub/browser/CPSSkins/trunk/skins/cpsskins_plone2/ > Plone performance tuning is something I need to learn more about > when I get time. If a Product can perform well with tuning thats great > but it can be an issue if its default behaviour is a performance hit > and it therefore imposes a performance tuning requirement. (Not > implying that this is true of CPSSkins). the biggest performance hit in plone comes from the fact that the product relies too much on zope page templates, which 1) where not designed to be cached by fragments 2) they use methods located in user space (python scripts, etc) and 3) the page template architecture needs to get all the parts rendered before the entire page can be displayed, so if one little portlet on the page takes 2 seconds to be render, it is the entire page will take 2 seconds to render. It is very difficult to isolate the slowest parts of the rendering chains. > I guess what you're saying is you do not believe there are > performance issues with CPSSkins, and you have evidence of a least one > situation to back this up. > So, I don't mean to cast aspersions, and I would still consider > looking into using CPSSkins in the future. :-) > Regards > Nick by design, the performance issues are tackled completely differently, since there are possibilities to cache page fragments. But again the Plone version of CPSSkins is one year behind the CPS version because the portlet caching architecture is missing in Plone. I don't know about PlonePortlets, but last time I tried they worked in CPSSkins. best /JM ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing args to PageTemplateFile instances
RESULT: --- Welcome to testprod {'args': (, http://localhost:8080/test/testprod/test_testprod>), 'something': 'blah'} 0 /test/testprod http://www.peterbe.com/test/TestProd.tgz So it works just fine in Zope 2.8.0 I suspect that the code you paste was idented wrong because the def testit() function looked like it was part of the __init__ function. 2005/9/23, Anders Bruun Olsen <[EMAIL PROTECTED]>: > On Fri, Sep 23, 2005 at 12:06:00PM +0100, Peter Bengtsson wrote: > > Please press "Reply-All" and not just to me. > > Sorry about that. > > > That is the correct way of calling PageTemplateFile objects in python > > code. I've got it working in many places. The error must be either a > > new zope bug or something else being wrong. Is your setup as simple as > > you've described in the email? > > Yes. This is the class I am using: > > class TestProd(SimpleItem): > """A TestProd object""" > meta_type = "TestProd" > manage_options = ( {"label": "Edit", "action": "manage_main"}, > {"label": "View", "action": "index_html"}) > > manage_main = PageTemplateFile("templates/mainTestProd", globals()) > index_html = PageTemplateFile("templates/indexTestProd", globals()) > test = PageTemplateFile("templates/test", globals()) > > def __init__(self, id, title): > self.id = id > self.title = title > > def testit(self, REQUEST=None): > return self.test(self, self.REQUEST, something="blah") > > And the "test" template: > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> > > >/> > > > TITLE > > > > Welcome to tal:replace="container/title_or_id"/> > > > > > > > > I have added it to the rootfolder in ZMI with the ID "testing". > > > What happens when you in that TAL do something like: > > > > Gives: {'args': ()} > > > Do the other namespaces work in the page template? Eg. > tal:replace="python:len(request.form.keys())" /> or > Gives: 0 > > > tal:replace="python:context.absolute_url_path()" /> > > Gives: /testing > > -- > Anders > -BEGIN GEEK CODE BLOCK- > Version: 3.12 > GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V > PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y? > --END GEEK CODE BLOCK-- > PGPKey: > http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0xD4DEFED0 > -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: JSON for Ajax applications
Jean-Marc Orliaguet wrote: Max M wrote: JSON (JavaScript Object Notation) is a lightweight data-interchange format. this is used at 100% and more in cpsskins for Zope3 (cf. z3lab.org). You might also have a look at Jim Washington's 'jsonserver' for Zope3 and its implementation for Zope2 http://zif.hill-street.net/jsonserver I read the posts about jsonserver, but somehow it didn't register on my radar. I read it as "Johnson-server" so i dismissed it, thinking it was some kind of "personal" project :-/ But it looks increasingly sexy ... -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing args to PageTemplateFile instances
On Fri, Sep 23, 2005 at 12:06:00PM +0100, Peter Bengtsson wrote: > Please press "Reply-All" and not just to me. Sorry about that. > That is the correct way of calling PageTemplateFile objects in python > code. I've got it working in many places. The error must be either a > new zope bug or something else being wrong. Is your setup as simple as > you've described in the email? Yes. This is the class I am using: class TestProd(SimpleItem): """A TestProd object""" meta_type = "TestProd" manage_options = ( {"label": "Edit", "action": "manage_main"}, {"label": "View", "action": "index_html"}) manage_main = PageTemplateFile("templates/mainTestProd", globals()) index_html = PageTemplateFile("templates/indexTestProd", globals()) test = PageTemplateFile("templates/test", globals()) def __init__(self, id, title): self.id = id self.title = title def testit(self, REQUEST=None): return self.test(self, self.REQUEST, something="blah") And the "test" template: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> TITLE Welcome to I have added it to the rootfolder in ZMI with the ID "testing". > What happens when you in that TAL do something like: > Gives: {'args': ()} > Do the other namespaces work in the page template? Eg. tal:replace="python:len(request.form.keys())" /> or tal:replace="python:context.absolute_url_path()" /> Gives: /testing -- Anders -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y? --END GEEK CODE BLOCK-- PGPKey: http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0xD4DEFED0 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: CPSSkins perfs
Jean-Marc Orliaguet wrote: Hi! I usually don't read the posts on zope-list, but I found this one: http://mail.zope.org/pipermail/zope/2005-September/161330.html sorry this is a bit old, but ... M. Davis, what are your benchmark figures based on? I just ran a quick benchmark on Plone's front page and found: siege -v -r 10 -c 1 http://localhost:8080/plone ** siege 2.61 ** Preparing 1 concurrent users for battle. The server is now under siege... Jean-Marc, Hello. To be honest I didn't actually benchmark this scientifically. So very sorry if I did a bad thing and made a statement against the performance of CPSSkins that is not actually true. I liked the look of CPSSkins, but looked into it a bit and thought, this does too much , its too clever. That means the rendering is more complex which will hit performance. Also a sophisticated product is possibly more likely to break doing a migration such as to Plone 2.1. Its a more complicated product to maintain perhaps. Thats not entirely scientific either because something well-written by good programmers who understand Plone well may be more "migration-proof" than a simpler but sloppier-written Product. But I take an attitude that while Zope/Plone is great, a certain amount is still bleeding edge and brittle, so don't try to be too clever. My colleague got burnt by pushing the limits of a bleeding edge version of Archetypes (1.2.5). We're still struggling to migrate to 1.3.4. On the other hand some people need to push the limits in order that advanced features get their bugs found and fixed. Plone performance tuning is something I need to learn more about when I get time. If a Product can perform well with tuning thats great but it can be an issue if its default behaviour is a performance hit and it therefore imposes a performance tuning requirement. (Not implying that this is true of CPSSkins). I guess what you're saying is you do not believe there are performance issues with CPSSkins, and you have evidence of a least one situation to back this up. So, I don't mean to cast aspersions, and I would still consider looking into using CPSSkins in the future. :-) Regards Nick ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing args to PageTemplateFile instances
2005/9/23, Anders Bruun Olsen <[EMAIL PROTECTED]>: > > Why the extra self-wrapping. > > Do it this way: > > def testit(self, REQUEST=None): > > return self.test(self, self.REQUEST, something="blah") > > Then you'll be able to use: > > > > Thanks, I have now tried that, but it still does not work. I still get: > > Error Type: KeyError > Error Value: 'something' > Please press "Reply-All" and not just to me. That is the correct way of calling PageTemplateFile objects in python code. I've got it working in many places. The error must be either a new zope bug or something else being wrong. Is your setup as simple as you've described in the email? What happens when you in that TAL do something like: Do the other namespaces work in the page template? Eg. or -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] JSON for Ajax applications
Max M wrote: > I don't know how many has seen this, but it's pretty cool. > > JSON (JavaScript Object Notation) is a lightweight data-interchange > format. > > http://www.crockford.com/JSON/index.html > > It is used for Ajax applications to transfer data instead of xml. It > uses repr() versions of standard python objects like dicts, lists, > string, numbers etc. to transfer data. > > It is really simple to generate for Python programmers, so it is very > simple to use in Zope too. > > this is used at 100% and more in cpsskins for Zope3 (cf. z3lab.org). You might also have a look at Jim Washington's 'jsonserver' for Zope3 and its implementation for Zope2 http://zif.hill-street.net/jsonserver /JM ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing args to PageTemplateFile instances
> manage_main = PageTemplateFile("templates/mainTestProd", globals()) > index_html = PageTemplateFile("templates/indexTestProd", globals()) > test = PageTemplateFile("templates/test", globals()) > > def __init__(self, id, title): > self.id = id > self.title = title > > def testit(self, REQUEST=None): > return self.test.__of__(self)(something="blah") > > > In the template I should now be able to access options/something > according to previous posts, but this: > > > Why the extra self-wrapping. Do it this way: def testit(self, REQUEST=None): return self.test(self, self.REQUEST, something="blah") Then you'll be able to use: -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] JSON for Ajax applications
I don't know how many has seen this, but it's pretty cool. JSON (JavaScript Object Notation) is a lightweight data-interchange format. http://www.crockford.com/JSON/index.html It is used for Ajax applications to transfer data instead of xml. It uses repr() versions of standard python objects like dicts, lists, string, numbers etc. to transfer data. It is really simple to generate for Python programmers, so it is very simple to use in Zope too. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )