Re: [Zope-dev] [ZPublisher] specifiying 'charset' for the content-type header
Andreas Jung wrote: No. Imagine a PythonScript that returns a unicode string. The ZPublisher converts the unicode string to latin1 (zpublisher_default_encoding). Most browsers will default Latin1 when they can't find the charset in the content-type header. When you configure the ZPublisher to convert output to utf-8 then browsers will still default to Latin1 although the output it utf-8. So we tell the browser which encoding the ZPubisher was using to produce the output. Ah, okay, and how would I indicate in my PythonScript return that I'm returning something different to what is specified in zpublisher_default_encoding? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [ZPublisher] specifiying 'charset' for the content-type header
--On 4. Januar 2006 11:23:09 +0200 Chris Withers [EMAIL PROTECTED] wrote: Andreas Jung wrote: No. Imagine a PythonScript that returns a unicode string. The ZPublisher converts the unicode string to latin1 (zpublisher_default_encoding). Most browsers will default Latin1 when they can't find the charset in the content-type header. When you configure the ZPublisher to convert output to utf-8 then browsers will still default to Latin1 although the output it utf-8. So we tell the browser which encoding the ZPubisher was using to produce the output. Ah, okay, and how would I indicate in my PythonScript return that I'm returning something different to what is specified in zpublisher_default_encoding? By setting the content-type header _with_ a 'charset' set. -aj pgpTZx14JhSWm.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] [Zope 2.10] ZPT going Unicode
As you might know I worked on the integration of the Zope 3 ZPT implementation for Zope 2.10. Before commiting the changes to the trunk I would like discuss my approach for Zope 2.10 - the ZopePageTemplate and PageTemplateFile classes will be replaced with wrapper classes around corresponding Zope 3 classes (no changes to the API, the existing unittest do pass with the wrappers) - the wrapper implementations store the content as Python unicode strings. The encoding of the content must be specified when creating/uploading new instances (either through the ZMI or through the 'encoding' parameters of the constructors). If the content is XML-ish then the encoding is taken from the XML preamble (defaults to utf8) - the ZMI screens for ZPTs use a _fixed_ UTF-8 encoding (is this also fine for asian users?) - deprecation of _all_ other methods, modules etc. from Products/PageTemplates (removal in 2.12 except of the wrapper classes) - deprecation of the TAL module (removal in 2.12) Open: - The ZPublisher will convert a 'unicode' ZPT using default_zpublisher_encoding (zope.conf) to a byte stream. The current encoding is iso-8859-15. I think it would make sense to change it to utf8. Otherwise we must explicitly set the content-type with charset=utf8 set. Thoughts? ToDo: in-place conversion of persistent ZPT instance through setstate() or so... Andreas pgp5yexs8WBFr.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope tests: 8 OK
Summary of messages to the zope-tests list. Period Wed Jan 4 12:01:01 2006 UTC to Thu Jan 5 12:01:01 2006 UTC. There were 8 messages: 8 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:02:51 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003930.html Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:04:22 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003931.html Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:05:52 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003932.html Subject: OK : Zope-2_7-branch Python-2.4.2 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:07:22 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003933.html Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:08:52 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003934.html Subject: OK : Zope-2_8-branch Python-2.4.2 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:10:22 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003935.html Subject: OK : Zope-2_9-branch Python-2.4.2 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:11:52 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003936.html Subject: OK : Zope-trunk Python-2.4.2 : Linux From: Zope Unit Tests Date: Wed Jan 4 21:13:22 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-January/003937.html ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [Zope 2.10] ZPT going Unicode
--On 5. Januar 2006 12:47:20 +0100 Andreas Jung [EMAIL PROTECTED] wrote: As you might know I worked on the integration of the Zope 3 ZPT implementation for Zope 2.10. Before commiting the changes to the trunk I would like discuss my approach for Zope 2.10 I forgot to mention a major point: compatibility. When a ZPT is internally stored a unicode string then content returned by methods called through the ZPT will be implicitly converted to unicode. This will definitely raise UnicodeDecodeErrors. So how to deal with this issue? - allowing only unicode textual content when calling macros, PyScript etc. - converting non-unicode to unicode inside the TAL code using some encoding. The encoding could be specified as property of the called method (function properties) or object. We really _need_ to discuss this issue early to minimize side effects and to be able to provide the best compatibility possible. -aj pgpApldUaM8nO.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: [Zope 2.10] ZPT going Unicode
Andreas Jung wrote: ToDo: in-place conversion of persistent ZPT instance through setstate() or so... Could we avoid doing things in __setstate__ please? It imposes a runtime cost that doesn't disappear. I'd rather have a one-time update method that trawls the database, like is done for Python Scripts recompiling for instance. Or I can call it myself in my upgrade procedures on the exact objects I know will need updates. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: [Zope 2.10] ZPT going Unicode
--On 5. Januar 2006 17:36:45 +0100 Florent Guillaume [EMAIL PROTECTED] wrote: Andreas Jung wrote: ToDo: in-place conversion of persistent ZPT instance through setstate() or so... Could we avoid doing things in __setstate__ please? It imposes a runtime cost that doesn't disappear. I'd rather have a one-time update method that trawls the database, like is done for Python Scripts recompiling for instance. Or I can call it myself in my upgrade procedures on the exact objects I know will need updates. I've implemented the setstate() variant as proof-of-concept. I am not sure if there is overhead for CMF-based sites since they FSPageTemplates inherit from PageTemplateFile which has nothing in mind with persistence. So only persistent ZopePageTemplate would be affected. If there is need for a dedicated migration we could easily write one..that's the lamest task of the whole ZPT unicode issue :-) -aj pgpo72s9XA6e2.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: [Zope 2.10] ZPT going Unicode
Florent Guillaume wrote: Andreas Jung wrote: ToDo: in-place conversion of persistent ZPT instance through setstate() or so... Could we avoid doing things in __setstate__ please? It imposes a runtime cost that doesn't disappear. I'd rather have a one-time update method that trawls the database, like is done for Python Scripts recompiling for instance. Or I can call it myself in my upgrade procedures on the exact objects I know will need updates. Perhaps we can use the generations framework. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] buildbot failure in Zope branches 2.9 2.4 Windows 2000 zc-bbwin2
The Buildbot has detected a failed build of Zope branches 2.9 2.4 Windows 2000 zc-bbwin2. Buildbot URL: http://buildbot.zope.org/ Build Reason: changes Build Source Stamp: 2603 Blamelist: tim_one BUILD FAILED: failed failed slave lost sincerely, -The Buildbot ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] buildbot failure in Zope trunk 2.4 Windows 2000 zc-bbwin6
The Buildbot has detected a failed build of Zope trunk 2.4 Windows 2000 zc-bbwin6. Buildbot URL: http://buildbot.zope.org/ Build Reason: changes Build Source Stamp: 2609 Blamelist: andreasjung,efge,hdima,jim,oestermeier,tim_one BUILD FAILED: failed failed slave lost sincerely, -The Buildbot ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [Zope 2.10] ZPT going Unicode
Andreas Jung wrote at 2006-1-5 13:39 +0100: ... I forgot to mention a major point: compatibility. When a ZPT is internally stored a unicode string then content returned by methods called through the ZPT will be implicitly converted to unicode. This will definitely raise UnicodeDecodeErrors. So how to deal with this issue? - allowing only unicode textual content when calling macros, PyScript etc. definitely not. - converting non-unicode to unicode inside the TAL code using some encoding. The encoding could be specified as property of the called method (function properties) or object. Using a site encoding would probably be the best way (as done by e.g. Plone and Archetypes). Most sites use in fact a fixed encoding most of the time. At the places where a different encoding is used, it can be employed explicitely to convert to unicode. As pointed out in private email (charset negociation will not work), the response charset has a significant impact on the charset used in form data sent back to the server. This may pose severe problems when the response charset is not the same as the site encoding (for textual form data). -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: [Zope 2.10] ZPT going Unicode
Andreas Jung wrote at 2006-1-5 17:44 +0100: ... I'd rather have a one-time update method that trawls the database, like is done for Python Scripts recompiling for instance. Or I can call it myself in my upgrade procedures on the exact objects I know will need updates. I've implemented the setstate() variant as proof-of-concept. I am not sure if there is overhead for CMF-based sites since they FSPageTemplates inherit from PageTemplateFile which has nothing in mind with persistence. So only persistent ZopePageTemplate would be affected. If there is need for a dedicated migration we could easily write one..that's the lamest task of the whole ZPT unicode issue :-) Modern ZODB versions allow modifications made in __setstate__ to be reliably persisted. This means that __setstate__ updates can now be one time (though the test whether an upgrade is necessary is done always). The recompile hack for PythonScripts would no longer be necessary. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope] ZServer threads and pool-size question
Thanks, I will try that ;) -Message d'origine- De : Dieter Maurer [mailto:[EMAIL PROTECTED] Envoyé : mercredi 4 janvier 2006 19:52 À : Pascal Peregrina Cc : Jens Vagelpohl; zope list user Objet : RE: [Zope] ZServer threads and pool-size question Pascal Peregrina wrote at 2006-1-4 13:34 -: I understand. So what is the typical value to use for pool-size given a certain threads number: n+3 ? It depends on how intensively you are using additional (application level) threads: Each thread using persistent objects requires in general (at least) one ZODB connection. As such threads are relatively rare, additional 3 connections is not too bad for the general case. -- Dieter ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.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] Re: ZServer threads and pool-size question
I saw that once on Zope 2.8.4, cause I was using a connection in a independent thread not linked to any incoming request and had forgotten about it ;) Never since then, so it looks like threads = pool size is fine for my setup. Can you confirm this feature is included in Zope 2.8 ? Pascal -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Florent Guillaume Envoyé : mercredi 4 janvier 2006 15:43 À : Jens Vagelpohl Cc : zope@zope.org Objet : [Zope] Re: ZServer threads and pool-size question Jens Vagelpohl wrote: On 4 Jan 2006, at 13:23, Pascal Peregrina wrote: Can anyone tell me why, by default in a zope instance config file, the connection pool size is 7 while the number of zserver threads is 4? Why not 4 and 4? Because under some conditions you can actually have more than 4 connections in use. Not having extra connections available has the potential to block the server. That's not true anymore in recent ZODBs. Zope 2.9 will never block and always allocate new connections as needed. It will log warnings if the number grows too much though. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [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 ) ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.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] dynamically creating zip file, returning to user
John Toews schrieb: Zope 2.8.0, Python 2.3.5 I'm having a heck of a time figuring out how to zip up some files in my zope instance and return them to the user. I can sucessfully create a zip file on the local file system, but if I try to pass it back to the user it is corrupted. Of course I'd rather not create this tmp3.zip file, so if there's a way around that (which I'm sure there is!) please do let me know. filename = 'test.zip' response = self.REQUEST.RESPONSE response.setHeader('Content-Type','application/zip') response.setHeader('Content-Disposition','attachment; filename=%s' % filename) # tried zf = zipfile.ZipFile( response, 'w' ) but get error, ZHTTP object doesn't have tell method zf = zipfile.ZipFile( '/tmp3.zip', 'w' ) zf.writestr( 'testfilename', str( self._getOb( testfileid ) ) ) zf.close() f = open('/tmp3.zip') return f.read() Try with zipefile.ZipFile(response,a), this should avoid the use of tell (untestet) otoh, If you'd use the tempfile module and dont return f.read() but use FileStreamIterator with it, you even have a win performance-wise. HTH Tino ___ 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: Cookie Crumbler
Hi Infor, I found that my weakness is that I am DTML scripter. After printing the Cookie Crumbler source code, I need some help/advice as how to access the Cookie Crumbler methods or api from DTML. I have searched the Zope documents however have found none that can help. I would appreciate some advice or pointers. Thank you. Infor Gates info_gates-/[EMAIL PROTECTED] wrote: Dear zopist I have a trying time using Cookie Crumbler 1.2 with Zope2.8.4 (windows version). I could NOT figure out how to log out a user. I have simplified to the orginal logged_out form to this: dtml-call RESPONSE.expireCookie('__ac_name') a href=/manage_zmi_logoutlogout/a Except for the /manage_zmi_logout part, I'm using some similar script. I'm using it on zope 2.6.4 and it works. I don't know if it works in 2.8.4. Anyway, here it is: dtml-call REQUEST['RESPONSE'].expireCookie('__ac', path='/') dtml-call REQUEST['RESPONSE'].expireCookie('__ac', path='/') Note: Yes, I expired the cookie twice. If I'm not wrong, I recall to have had problems with only one call (Not sure). Regards, Josef ___ 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] Cookie Crumbler
Yes, after reading the source code. However, my problem as I found out is that I do not know how to access the methods in CC from DTML. I am not well verse with Python (still learning though).Thank you.Dieter Maurer [EMAIL PROTECTED] wrote: Infor Gates wrote at 2006-1-4 20:14 -0800:I have a trying time using Cookie Crumbler 1.2 with Zope2.8.4 (windows version).I could NOT figure out how to log out a user. I have simplified to the orginal logged_out form to this:The "Cookie Crumber" has a "logout" method.You should use it for the logout (and not try to emulate it yourself).You can activate it via an URL of the form:url_to_your_cookie_crumbler/logoutIt will redirect to the "logout_page" (you can configure foryour "Cookie Crumbler".-- Dieter Yahoo! Photos Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.___ 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] migrating a zodb
I installed zope 2.7.4 from FreeBSD packages. Trouble is that I already had python 2.4 installed. It appears the package just used that version of python since zope says it is using python 2.4. I've run in to a few wierd things and would like to get a zope instance a little more reliable. I was thinking of just making a copy of my zodb file, removing the zope pkgs, then do a source install with python 2.3. Is the zodb file plug and play transferrable? Can I just copy the zodb into the a new zope instance and go?-- 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] migrating a zodb
At Thursday 5/1/2006 19:55, David Bear wrote: I installed zope 2.7.4 from FreeBSD packages. Trouble is that I already had python 2.4 installed. It appears the package just used that version of python since zope says it is using python 2.4. I've run in to a few wierd things and would like to get a zope instance a little more reliable. I was thinking of just making a copy of my zodb file, removing the zope pkgs, then do a source install with python 2.3. Is the zodb file plug and play transferrable? Can I just copy the zodb into the a new zope instance and go? Yes, usually. That depends a bit on the Products you have installed. When you remove a product, all its instances will become broken (your zodb might contain such old instances even if unused). Or, if the product does some not-so-portable things like storing a full path to an external file as an attribute (there are some examples...) you'll have some problems if you install into another directory. But in general, if no such odd things happen, it's just plug and play. Gabriel Genellina Softlab SRL ___ 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] Change object/role permissions w/ python?
Hi all, I have a need to restrict anonymous access to an object until after a specific action occurs. For example, the View permission by default is restricted to owner and manager, but after a 'release' flag is checked, it is viewable to anyone. I can't seem to find a way to do this programatically, after googling for a few hours over the past few weeks. Is it possible? I think the user running the action would need 'change permissions' rights... is there anyway to override that? Thanks again! John ___ 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] Change object/role permissions w/ python?
John Toews wrote: Hi all, I have a need to restrict anonymous access to an object until after a specific action occurs. For example, the View permission by default is restricted to owner and manager, but after a 'release' flag is checked, it is viewable to anyone. I can't seem to find a way to do this programatically, after googling for a few hours over the past few weeks. Is it possible? I think the user running the action would need 'change permissions' rights... is there anyway to override that? Thanks again! John John, Here's a solution that at best will stimulate a better answer :-) a href="" tal:condition="python: request.get(releaseFlag,0)"some link /a or a href="" tal:condition="python: not request.get(releaseFlag,0)"some other link /a 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] Change object/role permissions w/ python?
On Thu, 5 Jan 2006 19:13:13 -0800 John Toews [EMAIL PROTECTED] wrote: I have a need to restrict anonymous access to an object until after a specific action occurs. For example, the View permission by default is restricted to owner and manager, but after a 'release' flag is checked, it is viewable to anyone. I can't seem to find a way to do this programatically, after googling for a few hours over the past few weeks. Is it possible? I think the user running the action would need 'change permissions' rights... is there anyway to override that? 1) Provide a script that makes this change. 2) Give it the necessary permissions 3) Use the proxy feature to allow the script to run with its own permissions when called (look at the tabs available on the script editing view) 4) Call this script from the action on your release form. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.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] dynamically creating zip file, returning to user
John Toews schrieb: Thanks Tino, I'll definately give that a try too. The quick fix seemed to be opening the file for read in binary mode... that should have been obvious. Posting another dumb question to the list now. ;) no, dot use a regular file! Use the tempfile module! And dont reopen but seek to the start - f.seek(0) You just open it for rw. ___ 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 )