[Zope-dev] Five within Zope 2.8 - really cool !
I just would like to thank everyone working on the Five integration with Zope 2.8. It's really easy and fun to work with views, view classes, adapters and interfaces in a Zope 2 environment. I've always tried to get around Zope 3 somehow but now I am at the point where I am really convinced and healed :-) It was a good decision to ship Five now instead in Zope 2.9 or so. I am sure Five will make Z2 application design a lot more straight forward and cleaner...thanks...great work. Andreas pgpgUvm08EIru.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: [Zope2.8a2] ...to be released by tomorrow....
Tres Seaver wrote: I still have a notion that some improvements made on the 2.7 branch are not merged into the SVN trunk, e.g. http://cvs.zope.org/Zope/lib/python/AccessControl/Attic/ZopeGuards.py.diff?r1=1.16.2.3r2=1.16.2.4 There is some debate here whether those changes (which Jim made only relunctantly back in January 2004) should be promulgated to 2.8. We will fold them in after the alpha, if so. The link above points to an other unmerged change. I don't understand the complete change, but at least removing Python 2.1 compatibility code should also be done on the trunk. Cheers, Yuppie ___ 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: post publishing hook
Dieter Maurer [EMAIL PROTECTED] wrote: Christian Heimes wrote at 2005-4-1 22:28 +0200: ... You want to bind some actions to the transaction system because you want to execute some code at the end of the first phase of the 2 phase commit. I do not think that Florent wants to execute things at the end or in the first commit phase. Instead, he wants to execute something *BEFORE* this phase. Yes, wherever it's inserted, I want to do additional processing before everything is finalized, and in some cases I want to be able to abort the transaction, and to create and change objects in the ZODB. Hooking into the transaction machinery of ZODB is very easy. Write your own DateManager implementing the IDateManager interface and register it into the current transaction using get_transaction.register(DM). For your use case overwrite the tpc_vote() method of the data manager to do the indexing at the boundary between the two phases. This will not work for Florent's use case, at least not in the current ZODB (for Zope 2.7). Reason: The transaction freezes the set of objects it processes in the commit *BEFORE* the first commit phase. Therefore, no tpc_vote is allowed to modify any persistent object. Failure to do so leads to extremely nasty persistency errors (the object is marked changed but no transaction knows about it -- no change to this object in the future will get persisted until a restart). Ah, that was what I was afraid of, but I was assured it was not the case. I'll have to reread that transaction code... and maybe readd the low-tech post-publishing hook I was thinking of. Thanks Dieter, 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 )
Re: [Zope-dev] Re: post publishing hook
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Dieter Maurer wrote: Christian Heimes wrote at 2005-4-1 22:28 +0200: ... You want to bind some actions to the transaction system because you want to execute some code at the end of the first phase of the 2 phase commit. I do not think that Florent wants to execute things at the end or in the first commit phase. Instead, he wants to execute something *BEFORE* this phase. That was the initial idea in our case. Hooking into the transaction machinery of ZODB is very easy. Write your own DateManager implementing the IDateManager interface and register it into the current transaction using get_transaction.register(DM). For your use case overwrite the tpc_vote() method of the data manager to do the indexing at the boundary between the two phases. This will not work for Florent's use case, at least not in the current ZODB (for Zope 2.7). Reason: The transaction freezes the set of objects it processes in the commit *BEFORE* the first commit phase. Therefore, no tpc_vote is allowed to modify any persistent object. Failure to do so leads to extremely nasty persistency errors (the object is marked changed but no transaction knows about it -- no change to this object in the future will get persisted until a restart). I've been implementing a IndexationManager hook doing the job for CPS but I get the error your talking about... Thanks Dieter for the explanation. Your mail just arrived when I was trying to understand the persistency problems :( I got POSKeyError, Unauthorized (at catalog level while indexing and trying to get object attributs) or KeyError (Connection.setState()) exceptions randomly as well. Is there a way to hook before the first transaction commit phase ? J. - -- Julien Anguenot | Nuxeo RD (Paris, France) CPS Plateform : http://www.cps-project.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFCUFReGhoG8MxZ/pIRAi2jAJ4hXTAJhqJB8czSkQpVCCBEKzWXtACfXA/m S4JfeBF+TWweLWPSoxobPEE= =8zPL -END 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] opinion: speeding up large PUT uploads
Zope's ZPublisher.HTTPRequest.HTTPRequest class has a method named processInputs. This method is responsible for parsing the body of all requests. It parses all upload bodies regardless of method: PUT, POST, GET, HEAD, etc. In doing so, it uses Python's FieldStorage module to potentially break apart multipart/* bodies into their respective parts. Every invocation of FieldStorage creates a tempfile that is a copy of the entire upload body. So in the common case, when a large file is uploaded via HTTP PUT (both DAV and external editor use PUT exclusively), here's what happens: - ZServer creates a tempfile T1 to hold the file body as it gets pulled in. - When the request makes it to the publisher, processInputs is called and it hands off tempfile T1 to FieldStorage. - FieldStorage reads the entire body and creates another tempfile T2 (an exact copy of T1*, in the case of a PUT request). - T2 is eventually put into REQUEST['BODYFILE']. (*) At least I can't imagine a case where it's not an exact copy. This is costly on large uploads. I'd like to change the top of the processInputs method to do this: if method == 'PUT': # we don't need to do any real input processing if we are # handling a PUT request. self._file = self.stdin return Can anyone think of a reason I shouldn't do this? - C ___ 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] Re: login page problem
I have been trying to think of ways of providing specific pointers, So, assuming you have a custom login page and a custom python script that processes that page: In the Python script you could set a cookie for the District: context.REQUEST.RESPONSE.setCookie('District', district) where district is the name of the District field in the form. The District parameter is then always available to your page templates and scripts in the REQUEST object. At the end of your login script you would typically redirect to some specific page like this: return context.REQUEST.RESPONSE.redirect('aURL') in exUserFolder you don't have to do anything else - the login works by magic, which is very confusing. Now for the problems: If the login is wrong the system will call /standard_error_message, so you have to customise that to send the user back to the login form with a Login failed message. If the user bookmarks a protected page and tries to jump to it without being logged in, the system will call the login sequence starting in acl_users, so you have to customise that to call your own login page. After the user has logged in, whenever you need to get the Username you would typically use a python script like this: from AccessControl import getSecurityManager return getSecurityManager().getUser().getUserName() HTH Cliff prabuddha ray wrote: Its been very kind of u all to be critical about a newbie like me. I'll definitely lookout for those ettiquetes. My python script error got solved as i missed the silly ' ' in the response.redirect statemnet. I set the user and pwd request vars in sesson var. Tried cookie crumbler and MysqlUserFolder and UserFolder also but they all need to changed much and my requirements are diffrent. I'm building a trial govt. site for stores management which was built previously in ASP. The login page takes the districtname , username and passwd . according to the type of user different menus are displayed. For this i need to have the districtname , username and passwd carried on throughout the session. my current requirement is to pass the session vars through the python script which is the action of the login form. I've gone through the zopebook but dint find much help there. can u plz tell me where do i get to know about pythopn scripting done in zope n ZPT examples. i'm really sorry for my erronous language. please dont overlook theese humble requests. On Fri, 1 Apr 2005 23:07:38 +0200, Dieter Maurer [EMAIL PROTECTED] wrote: prabuddha ray wrote at 2005-3-30 23:50 -0800: ... now my problem how n where do i check d pwd n redirect to the next zpt or the previous one if its wrong. Apparently, you need some background reading... Especially, you need to understand that HTTP is a stateless protocol and *EACH* request must somehow perform its own authentication. That's why usually login information is (somehow) coded in a cookie. You really should follow the advice to look at an existing UserFolder (they are responsible for authentication). You may need to adapt/extend an existing UserFolder. -- 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] Does anyone care whether we deprecate ZClasses?
Jim Fulton escribió: ZClasses are a feature that support through-the-web development. Many people have found them useful in the past, but they have some significant deficiencies, including: - They can't be managed with file-system tools, especially revision control systems like CVS and subversion. - They don't work well with Python development tools, like profilers and debugger. - They aren't being actively maintained. Most serious Zope developers stopped using them a long time ago and are frustrated that we still expend resources keeping them around. For example, the release of Zope 2.8 has been delayed by the requirement of getting ZClasses working with Zope 2.8. We could choose to deprecate ZClasses. If we deprecated them in Zope 2.8, they would still work in Zope 2.8 and Zope 2.9, but their support would be removed in Zope 2.10. Would anyone be upset if this happened? Jim My +1 for ZClasses deprecation And +1 for DTML deprecation Try to keep Zope simple Simple = GOOD Simple = EASY Simple = BUGLESS Simple = QUICK ___ 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] Does anyone care whether we deprecate ZClasses?
On Sun, 3 Apr 2005, Garito wrote: My +1 for ZClasses deprecation And +1 for DTML deprecation Try to keep Zope simple -1 for DTML deprecation. It serves a different purpose that ZPT-- DTML is Logic+HTML ZPT is HTML+Logic. ___ 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] Does anyone care whether we deprecate ZClasses?
--On Sonntag, 3. April 2005 14:57 Uhr +0200 Garito [EMAIL PROTECTED] wrote: And +1 for DTML deprecation Deprecating DTML was never an issue. So stop the discussion about DTML. We're talking about ZClasses. -aj pgp0r7S8eJ6rx.pgp Description: 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] Get all user folder instances
Hi I'm try to know the complet list of users in a Zope point with this structure: root acl_users (user folder) Folder1 acl_users (Pluggable user folder) Folder2 acl_users (Another user folder) Object1 Object2 how could I retrive the list of user folders (in this case: /acl_users, /Folder1/acl_users and /Folder1/Folder2/acl_users) It would be perfect something like: Object1.superValues('User Folder') But this only retrive User Folder's not Pluggable user folder's nor Another user folder's Is there any kind of method to query for security list of users? Thanks a lot!! ___ 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] Does anyone care whether we deprecate ZClasses?
Andreas Jung wrote at 2005-4-2 08:58 +0200: --On Freitag, 1. April 2005 16:52 Uhr -0500 Jake [EMAIL PROTECTED] wrote: want to use them going forward, but what are the reasons why not to support them as legacy into 3/2.10? To avoid that people use ZClasses in the future :-) ZClasses have a set of bugs (I know one) and weaknesses (I know two or three) but all in all they are easier than the alternatives. Thus, they still are a valuable feature... -- 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] Does anyone care whether we deprecate ZClasses?
Jake wrote: My question, since it now seems like I am not the only one using ZClasses I doubt that that is the case. is, why not support them? You listed out the reasons why someone wouldn't want to use them going forward, but what are the reasons why not to support them as legacy into 3/2.10? Are you saying you want them in 2.10 but not necessarily beyond that (e.g. 2.11)? Or that you don't see why we don't support them indefinately? It takes effort to support old features. We have to weigh the benefits against the cost of the feature. For example, Zope 2.8 has been delayed substantially due to the effort to keep them going. If people find them useful, then we can keep them, but we don't want to keep them otherwise. 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 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] question about manipulating zcatalog query results
Ira Sher wrote at 2005-4-1 14:29 -0700: I scoured the archives, and found mention of this problem, and a note by you, Dieter saying it was a problem with the 2.7 beta (this was back in May of 2004) but I can't find any subsequent mention of the issue Nobody mentioned it again -- until your report... You may try to remove the list(...) wrapping in your code. It should work without. If it does not, file a bug report to http://www.zope.org/Collectors/Zope;. -- 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] Get all user folder instances
Garito wrote at 2005-4-3 17:36 +0200: root acl_users (user folder) Folder1 acl_users (Pluggable user folder) Folder2 acl_users (Another user folder) Object1 Object2 how could I retrive the list of user folders (in this case: /acl_users, /Folder1/acl_users and /Folder1/Folder2/acl_users) The best method would be to know the meta types of all UserFolders you are using... It would be perfect something like: Object1.superValues('User Folder') superValues allows also a sequence of meta types (rather than a single one). -- 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] Re: login page problem
prabuddha ray wrote at 2005-4-2 04:38 -0800: ... I've gone through the zopebook but dint find much help there. can u plz tell me where do i get to know about pythopn scripting done in zope n ZPT examples. The Zope Book (2.7 edition, online) definitely gives help on python scripting -- retry please. You find ZPT examples in the examples folder of .../Products/PageTemplates. Import the zpt_examples.zexp into Zope (import/export). Of course, no general ressource provides direct answers to your very specific problems... -- 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] question about manipulating zcatalog query results
Dieter, I actually put the list in because one of the last suggestions in the archives to repair the problem had to do with enclosing the assignment in a list. The original code was essentially: if sorton == 'id': res=[(row.id.split().pop(), row) for row in results] res.sort() return res This doesn't work, either, in zope 2.7.4 or 2.7.5 with python 2.3.4 and 2.3.5 respectively, as far as I can see. Thanks for taking a look at things--I'll file a bug report (this is stopping me from migrating a site into 2.7) as you suggested ira On Apr 3, 2005 10:44 AM, Dieter Maurer [EMAIL PROTECTED] wrote: Ira Sher wrote at 2005-4-1 14:29 -0700: I scoured the archives, and found mention of this problem, and a note by you, Dieter saying it was a problem with the 2.7 beta (this was back in May of 2004) but I can't find any subsequent mention of the issue Nobody mentioned it again -- until your report... You may try to remove the list(...) wrapping in your code. It should work without. If it does not, file a bug report to http://www.zope.org/Collectors/Zope;. -- 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] SESSION invalidate method
Hi List, I am curious about the SESSION.invalidate() method. This code sets a SESSION key and value and then calls SESSION.invalidate(): tal:block define=dummy python:request.SESSION.set('Dodgers','Baseball') / p before invalidate /p p tal:content=python: request.SESSION / tal:block define=dummy python:request.SESSION.invalidate() / p after invalidate()/p p tal:content=python: request.SESSION / Produces this output: before invalidate id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: [('Dodgers', 'Baseball')] after invalidate() id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: [('Dodgers', 'Baseball')] It seems that SESSION.invalidate() does not take immediate effect. Seems like a developer could getinto trouble if the same script *both* does SESSION.invalidate() SESSION.set('something','somevalue'). Because after the script runs 'something' goes away when invalidate() finally occurs. And is the effect described above to be expected or do I have this wrong? Thanks, 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 )
[Zope] getting all fields from dynamic checkboxes
Hi, Has anyone found a way to get a list of boolean values from dynamically created checkboxes. I have created a bunch of checkboxes within a repeat loop like this: input type=checkbox class=noborder name=cb_array:list:int tal:attributes=tabindex tabindex/next; checked python:test(curr_prop, 'checked', None); but when I access the cb_array from my python script, I only get the checked values (and I can no longer match the values up with the checkbox they came from). any help on this would be appreciated. thanks in advance, Dan ___ 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] getting all fields from dynamic checkboxes
On Apr 4, 2005 9:00 AM, Dan E [EMAIL PROTECTED] wrote: Hi, Has anyone found a way to get a list of boolean values from dynamically created checkboxes. I have created a bunch of checkboxes within a repeat loop like this: input type=checkbox class=noborder name=cb_array:list:int tal:attributes=tabindex tabindex/next; checked python:test(curr_prop, 'checked', None); but when I access the cb_array from my python script, I only get the checked values (and I can no longer match the values up with the checkbox they came from). You need to keep a server-side list of the checkboxes and check which ones aren't there. Web browsers don't send back checkboxes that aren't checked - it's an HTML feature. -- 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] Does anyone care whether we deprecate ZClasses?
We could choose to deprecate ZClasses. If we deprecated them in Zope 2.8, they would still work in Zope 2.8 and Zope 2.9, but their support would be removed in Zope 2.10. Would anyone be upset if this happened? Another vote for depreciation. I've looked at ZClasses, got confused, and built a product to do the (quite simple) task in less time than I spent scratching my head at ZClasses. Personally I'd make them in to a Product for 2.10 and let anyone who cares make it work with 2.10. -- 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] script or external method ?
Hi all, i'm a new user of Zope; i'm studing it since two weeks and i think it's very interesting, 'cause has the same power of j2ee application server but it is much more easy to use! While i was developing my first Zope application i fell into this trouble: i would like to write a script that create a folder, put some file in it, and set some properties. The code i've writed imports date object from datetime package: this makes it doesn't work like a script (python), so i adapt code as an external method; but when i run the method Zope says that he can't find symbol 'container'... (mumble) Well, 2 are the questions: First, what i've to do to get service variable like like container, context, request, etc.. ? Which are differences between script and external method coding? i remember that the zope book indicates only imports. Ok, thank you for reading.. Valerio - Principiante? Fedora a mani basse. Esperto? Slackware. Talebano? Debian. Asceta misantropo? Linux from scratch - Unless unavoidable, no Word, Excel or PowerPoint attachments, please. See http://www.fsf.org/philosophy/no-word-attachments.html - ___ Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it ___ 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: SESSION invalidate method
hi David, I had the same problem, see this thread with a workaround, and this bug report: http://www.zope.org/Collectors/Zope/1594 regards, Sune B. Woeller David H wrote: Hi List, I am curious about the SESSION.invalidate() method. This code sets a SESSION key and value and then calls SESSION.invalidate(): tal:block define=dummy python:request.SESSION.set('Dodgers','Baseball') / p before invalidate /p p tal:content=python: request.SESSION / tal:block define=dummy python:request.SESSION.invalidate() / p after invalidate()/p p tal:content=python: request.SESSION / Produces this output: before invalidate id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: [('Dodgers', 'Baseball')] after invalidate() id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: [('Dodgers', 'Baseball')] It seems that SESSION.invalidate() does not take immediate effect. Seems like a developer could getinto trouble if the same script *both* does SESSION.invalidate() SESSION.set('something','somevalue'). Because after the script runs 'something' goes away when invalidate() finally occurs. And is the effect described above to be expected or do I have this wrong? Thanks, 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 ) ___ 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] Dynamic Zope Style Sheets with HTML 4.01 Strict
I do exactly the same thing, except that I do it directly in the ZPT : span tal:omit-tag= tal:define=setcontentype python:here.REQUEST.RESPONSE.setHeader('content-type', 'text/css')/ Pascal AH, an elegant solution! Thanks!! -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Andy Yates Envoyé : jeudi 31 mars 2005 21:53 À : zope@zope.org Objet : RE: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict Thanks! I've never used dtml for style sheets. I've always used page templates and never had a problem 'til now. Also, I don't see a way to set the content type on a dtml doc or method. I assume it would be text/html and then I back in the same boat. To restate my problem, FireFox in HTML 4.01 Strict mode does not seem to accept a style sheet if the content type is text/html. It needs to see text/css. (Of course IE is fat dumb and happy) Everything worked fine until I added this doc string to my page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; Unless somebody has some better magic this seems work. context.REQUEST.RESPONSE.setHeader('content-type', 'text/css') return context.stylesheet() This way I can leave the content type on the page template text/html so Zope is happy and make FireFox happy by overriding the content type to text/css. Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Winkler Sent: Thursday, March 31, 2005 12:00 PM To: zope@zope.org Subject: Re: [Zope] Dynamic Zope Style Sheets with HTML 4.01 Strict On Thu, Mar 31, 2005 at 11:38:59AM -0600, Andy Yates wrote: Am I going to have to write a python script to call the style sheet page template and change the content type or is there a better way to handle this? Page Templates are awkward to use for non-XML output. I never tried to use them for stylesheets. fwiw, I have good results using DTML Methods for my dynamic stylesheets. It's about the only thing I use DTML for anymore. Mine look roughly like this: dtml-with SomethingThatGivesMeABunchOfProperties body { background-color: dtml-mainBackgroundColor;; color: dtml-mainTextColor;; } /* more style rules follow */ ... /dtml-with -- 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 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 )
[Zope] Re: SESSION invalidate method
Sune B. Woeller wrote: hi David, I had the same problem, see this thread with a workaround, and this bug report: http://www.zope.org/Collectors/Zope/1594 regards, Sune B. Woeller David H wrote: Hi List, I am curious about the SESSION.invalidate() method. This code sets a SESSION key and value and then calls SESSION.invalidate(): tal:block define=dummy python:request.SESSION.set('Dodgers','Baseball') / p before invalidate /p p tal:content=python: request.SESSION / tal:block define=dummy python:request.SESSION.invalidate() / p after invalidate()/p p tal:content=python: request.SESSION / Produces this output: before invalidate id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: [('Dodgers', 'Baseball')] after invalidate() id: 11125588150079827980, token: 95966850A1xaz-gQYlU, contents: [('Dodgers', 'Baseball')] It seems that SESSION.invalidate() does not take immediate effect. Seems like a developer could getinto trouble if the same script *both* does SESSION.invalidate() SESSION.set('something','somevalue'). Because after the script runs 'something' goes away when invalidate() finally occurs. And is the effect described above to be expected or do I have this wrong? Thanks, David Sune, Thats great! Thanks. My tests confirm this excerpt from Collectors/Zope/1594: 'The suggestion ... to use context.session_data_manager.getSessionData() to get the session after the call to invalidate works - it gives me a new session object, and all is well :)' 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 )