Re: [Zope] Adding Carriage return/line feed to a text field
If you are using a textarea field for input you could also use a text area field for display, useful if the input might contain html tags. Therwise wrap the display in tags. Cliff MCDONNELL, LARRY wrote: Hi, I have a form that the field length for that element is set to 65k in the database. Using a textbox, the person can enter their information. I now want to view the text. I can again use a text box but what I want to do is this - If I use this format, the text is one line. Are there arguments or a script that will add carriage return/line feed after you set the parameters? Thanks, Larry McDonnell Coordinator of Educational Technology New Haven Public Schools 54 Meadow Street New Haven, CT 06519 [EMAIL PROTECTED] (203) 946-2440 ___ 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] Question regarding changing Zope site to another distro
Hi, I run this Zope/Plone site - www.dte.ua.pt I am no Zope guru. I've just managed, with my years on administrating Linux servers, to install it, as well as plone and a bunch of Products, and get it running. That's all. Just made after, a few hacks in Plone code, mainly to support authentication through HTTPS and a few more minor thingies. The server running Zope has been there for about three years (more or less), is running SuSE 9.0 and it was compiled as well as Pyhton. The latest versions of Zope and Python, were by that time 2.6.1 and 2.1.3 respectively. So, to live on the edge, i've instaled this versions under: /usr/local/zope and /usr/local/python I start zope with: /usr/local/zope/start & and in /usr/local/zope/start file, i have exec /usr/local/python/bin/python $cwd/z2.py -L 'pt_PT' -u zope "$@" I'm moving this machine to a more powerful one in which i'm going to install Red Hat Enterprise Linux 4. I remeber having installed it first in RedHat 9, and then switching it after a few days to SuSE 9.0, just by backing up /usr/local/zope directory and restoring it after in SuSE. No major issues with this. A couple of symbolic links did to tweaks that were needed. Now... I think my Zope is suffering from arthritis :( I can't undo any more, either in Zope nor Plone and i can't compress Zope's database without getting an error and... no database compressed. As if you care to rapidly browse the site, you will see it is indeed a small one, but the /usr/local/zope .bz2 tarball is already at 1 GB and increasing. Does this sympthoms means that i'm going to have troubles now migrating to RHEL 4 ? Maintaining the Zope and Python version of course and the same scheme. I don't want to upgrade Zope, nor Python, nor Plone. Any help would be apreciated. Warm Regards, -- Mário Gamito Bastard Administrator in $hell $Users, you better make your backups Key FingerPrint: 0x90DA8E3C ___ 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] index.html in Python Script?
Erik Myllymaki wrote: How do address a ZPT with a name like index.html in a Python Script? The following: request = container.REQUEST RESPONSE = request.RESPONSE if not request.has_key('next_state'): return container.index.html(context, request) returns: Error Type: AttributeError Error Value: index ___ 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 ) Erik, I think its failing at the DOT between index and html. Try something like: return container['index.html'](context,request) David ___ 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] index.html in Python Script?
thanks, and this seems to do what I want to: request = container.REQUEST RESPONSE = request.RESPONSE if not request.has_key('next_state'): return container['index.html'](context, request) Phillip Hutchings wrote: On 22/04/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote: How do address a ZPT with a name like index.html in a Python Script? The following: request = container.REQUEST RESPONSE = request.RESPONSE if not request.has_key('next_state'): return container.index.html(context, request) The . is the python object referencing notation, so you can't have a property called 'index.html' addressable in the normal way. Use getattr instead. return getattr(container, 'index.html')(context, request) It's all in the Zope documentation. ___ 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] index.html in Python Script?
On 22/04/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote: > How do address a ZPT with a name like index.html in a Python Script? > > The following: > > request = container.REQUEST > RESPONSE = request.RESPONSE > > if not request.has_key('next_state'): >return container.index.html(context, request) The . is the python object referencing notation, so you can't have a property called 'index.html' addressable in the normal way. Use getattr instead. return getattr(container, 'index.html')(context, request) It's all in the Zope documentation. -- Phillip Hutchings http://www.sitharus.com/ [EMAIL PROTECTED] / [EMAIL PROTECTED] ___ 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] index.html in Python Script?
How do address a ZPT with a name like index.html in a Python Script? The following: request = container.REQUEST RESPONSE = request.RESPONSE if not request.has_key('next_state'): return container.index.html(context, request) returns: Error Type: AttributeError Error Value: index ___ 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] Adding a folder
Paul Winkler wrote: On Thu, Apr 21, 2005 at 09:58:52AM -0500, Justin Fletcher wrote: I am rather new to Zope, and am having a little trouble hunting through the documentation to find what I need. ?Currently I am looking to write a script that when called will create a folder with a specified name. ? Eventually, of course, I will want to programatically add content to these folders, but for now just seeing the documentation on how to add the folders will be enough. There are examples of this (and tons of other cool stuff) on www.zopelabs.com It's also in the online Zope Book 2.7: http://www.plope.com/Books/2_7Edition/BasicScripting.stx#2-45 Thank you. This is exactly what I was looking for. Thanks again, -Justin ___ 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] backing up zope files
On Thu, Apr 21, 2005 at 05:48:40PM -0400, Abhilasha Chaudhary wrote: > Abhilasha Chaudhary wrote: > > >Thanks for the info. I downloaded the FSDump product and dumped my > >files to the file system. > >But when I ftp the files back to the zope interface, they lose their > >properties. Is there a > >way(other than PUT_factory) to ftp the dump so that the object > >properties are not lost? I see. I should have explained better: No, you can't ftp the results of FSDump and keep the properties. It's intended for use with FilesystemDirectoryView. There is no way to do what you're describing with FTP. We do most of our development on the filesystem and use FilesystemDirectoryViews to get zope to use the data. We used FSDump as a one-time convenience for copying scripts that were initially developed in Zope back to the filesystem with properties intact. -- Paul Winkler http://www.slinkp.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] backing up zope files
Abhilasha Chaudhary wrote: Thanks for the info. I downloaded the FSDump product and dumped my files to the file system. But when I ftp the files back to the zope interface, they lose their properties. Is there a way(other than PUT_factory) to ftp the dump so that the object properties are not lost? Paul Winkler wrote: On Thu, Apr 14, 2005 at 05:30:10PM -0400, Abhilasha Chaudhary wrote: Hi, I am trying to find out how I can back up all the zope files related to a particular project on the file system. I want to able to store the zope code in CVS. I use ftp to store the files from zope on the file system. But when I put back the files in the Zope area using ftp, the properties of the files all get converted to DTML and the application cannot be used. I know there is a utility called "PUT_factory" that allows you to specify the zope object you want, but I think this utility is not very useful when you want to convert to certain types of objects(e.g ZSQLmethod). I want to find out if there is a more graceful way of preserving zope object properties while backing up zope files to the file system? The FSDump product might help you. Or, just keep your code on the filesystem in the first place. Google for using Filesystem Directory Views outside of CMF. ___ 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] Newbie - Cannot cut and paste objects in ZMI
> Just got Zope 2.7.5 up and running on my Win2003 server with IIS. Was > working my way through the Book and the "Elvis" tutorial and I cannot > cut/copy objects and paste them in to other folders though the ZMI. > I'll check the object click cut...toolbar changes to display the paste > button but then I click to the object (folder) I want to move it to and > bam Paste button goes away... > I have not found any information if Zope will work with my config but it > seemed to be working until this issue > Again I am very green...reasonably familiar with windows and IIS but > Zope is a whole new ballgame. Check that you have cookies enabled, the ZMI uses cookes to store the clipboard data. -- Phillip Hutchings http://www.sitharus.com/ [EMAIL PROTECTED] / [EMAIL PROTECTED] ___ 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] Adding Carriage return/line feed to a text field
MCDONNELL, LARRY wrote: I have a form that the field length for that element is set to 65k in the database. Using a textbox, the person can enter their information. I now want to view the text. I can again use a text box but what I want to do is this – > If I use this format, the text is one line. Are there arguments or a script that will add carriage return/line feed after you set the parameters? You can wrap it in HTML tags. This preserves formatting on layout. Otherwise, you'll have to replace the newlines in your text with tags. Products.PythonScripts.standard.newline_to_br will do this for you, as will the newline_to_br attribute on the dtml-var tag. (You can find this in the Zope online help.) --jcc ___ 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] Newbie - Cannot cut and paste objects in ZMI
Hello all, Just got Zope 2.7.5 up and running on my Win2003 server with IIS. Was working my way through the Book and the "Elvis" tutorial and I cannot cut/copy objects and paste them in to other folders though the ZMI. I'll check the object click cut...toolbar changes to display the paste button but then I click to the object (folder) I want to move it to and bam Paste button goes away... I have not found any information if Zope will work with my config but it seemed to be working until this issue Again I am very green...reasonably familiar with windows and IIS but Zope is a whole new ballgame. Thanks for any help or info that would make my Zope experience a good one! ___ 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: changing select metadata
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Malthe Borch wrote: > Hello list, --- > > A quickie: > > I'm trying to change the expiration date of an object with this code: > > obj = getattr(context, id) > obj.editMetadata(expiration_date=...) > > which works very well, however all other metadata gets wiped out :( Now, > what's > the method that works the other way, i.e. only change the provided attributes > and leave the others be? This question is CMF-specific, and thus belongs on the zope-cmf list (zope-cmf@lists.zope.org). The API for setting individual methods is defined in Products/CMFCore/interfaces/DubliinCore in the MutableDublinCore interface; in particular, you want: obj.setExpirationDate(value) Tres. - -- === Tres Seaver[EMAIL PROTECTED] Zope Corporation "Zope Dealers" http://www.zope.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCZ+7vGqWXf00rNCgRApwyAKCFFYE7fk+wWweHO1OKwpTq+OcA4QCfS3GJ OES23ogaVF94CQrfy13BqBI= =0jzG -END PGP SIGNATURE- ___ 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] Adding Carriage return/line feed to a text field
Hi, I have a form that the field length for that element is set to 65k in the database. Using a textbox, the person can enter their information. I now want to view the text. I can again use a text box but what I want to do is this – If I use this format, the text is one line. Are there arguments or a script that will add carriage return/line feed after you set the parameters? Thanks, Larry McDonnell Coordinator of Educational Technology New Haven Public Schools 54 Meadow Street New Haven, CT 06519 [EMAIL PROTECTED] (203) 946-2440 ___ 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] changing select metadata
Hello list, --- A quickie: I'm trying to change the expiration date of an object with this code: obj = getattr(context, id) obj.editMetadata(expiration_date=...) which works very well, however all other metadata gets wiped out :( Now, what's the method that works the other way, i.e. only change the provided attributes and leave the others be? \malthe ___ 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] Adding a folder
On Thu, Apr 21, 2005 at 09:58:52AM -0500, Justin Fletcher wrote: > I am rather new to Zope, and am having a little trouble hunting through > the documentation to find what I need. ?Currently I am looking to write > a script that when called will create a folder with a specified name. ? > Eventually, of course, I will want to programatically add content to > these folders, but for now just seeing the documentation on how to add > the folders will be enough. There are examples of this (and tons of other cool stuff) on www.zopelabs.com It's also in the online Zope Book 2.7: http://www.plope.com/Books/2_7Edition/BasicScripting.stx#2-45 -- Paul Winkler http://www.slinkp.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] Adding a folder
I am rather new to Zope, and am having a little trouble hunting through the documentation to find what I need. Currently I am looking to write a script that when called will create a folder with a specified name. Eventually, of course, I will want to programatically add content to these folders, but for now just seeing the documentation on how to add the folders will be enough. Thanks, -Justin ___ 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] Product data acquisition by
I am working some on a product where I have some problems making a nice interface to the calling dtml-code. My product grabs and caches RSS data for a feed, and now I would like to make an interface much like the one that is provided by the "Z SQL Method". My problem is that I can't find any documentation or examples of how to make this work with the acquisition. I would like to be able to do something like this to show the results of the object my_feed: I have found out that I in my product class can have a __len__() function that returns the result size and a __getitem__() function that returns a numbered element. If I return a mapping from that function I can access the resulting values as I want, but to make it work I need to add the "mapping" attribute to my -tag. I would like to get the same result without having to tell dtml-in that it's a mapping, just like "Z SQL Method" does. I have tried to understand the "Z SQL Method" code, and I see that it returns objects of a result class from the __getitem__() function. Is there any specifications telling which functions such a class needs to implement? I have tried doing such a result class, but when I execute the code I get: Error Value: unbound Python method must be called with RSSItem 1st argument Can anyone please point me to some documentation or in any other way enlighten me? Thanks in advance! -- Anders KarlssonEmail: [EMAIL PROTECTED] Cendio AB WWW:www.cendio.se Teknikringen 3,Voice: +46 - (0)13 - 21 46 00 SE-583 30 LINKÖPING, SWEDEN Fax:+46 - (0)13 - 21 47 00 ___ 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] [python script] problem with AUTHENTICATED_USER
Jürgen Herrmann wrote: hi: AUTHENTICATED_USER is in REQUEST: hence you could write ... self.REQUEST.AUTHENTICATED_USER.has_role(self, ["Manager"]) ... Yes, but this is deprecated. Do what Andreas said :-) 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] repozo over nfs?
On Apr 21, 2005, at 13:16, Sascha Ottolski wrote: What bothers me, however, is the fact, that the backup process is real hit on the overall performance (espacially . The server in question has a RAID-5 setup, storing the backups on the same array as it reads the Data.fs from. Obviously, this keeps the harddisk quite busy during the backup. This is, to be frank, a bad setup for a ZEO server. ZEO servers are I/O-bound and need the disk to be as fast as possible. I'd recommend moving away from RAID-5 to something simpler like RAID-1. Now, did anyone try to let repozo write the backups onto a nfs share on another machine? Would that reduce the hit? Yes. At least the backup write activity would hit some other disk. Besides that, how often do you guys run your backups? In fact, I never needed to recover one until now, but if the case ever happens, I would prefer to have as recent data as possible, of course. There is no golden rule. It all depends on your specific setup and how fast your data grows, and of course how recent you want to be if you need to restore from backup. I haven't had a setup where backup needs were so urgent that an hourly backup was done, nightly has been good enough so far. With weekly packing. jens ___ 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] repozo over nfs?
Hi, I'm wondering how and how often people run repozo. Myself am running it to perform one full backup every night (after a pack), and a incremental one every hour (which needs about 15 min. with nice -n19). What bothers me, however, is the fact, that the backup process is real hit on the overall performance (espacially . The server in question has a RAID-5 setup, storing the backups on the same array as it reads the Data.fs from. Obviously, this keeps the harddisk quite busy during the backup. Now, did anyone try to let repozo write the backups onto a nfs share on another machine? Would that reduce the hit? Besides that, how often do you guys run your backups? In fact, I never needed to recover one until now, but if the case ever happens, I would prefer to have as recent data as possible, of course. Thanks, Sascha ___ 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] batch processing with CMFPhotoAlbum
Hello list, --- In the sake of usability, I'd like to offer my users the ability to upload a compressed archive (i.e. zip og tarball) of photos, so that uploading a roll of film isn't a days work, but rather two or three clicks. Obviously, there still would be a need to do a group-rename afterwards, but the idea is pretty solid I think. I'll want to use the standard way of adding a photo, only also allow for archives in the submission process. Would anyone care to collaborate or share ideas on such a patch? I assume it would be useful with other media as well. \malthe ___ 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 )